Skip to content

Instantly share code, notes, and snippets.

@qiyuangong
Last active May 27, 2017 13:32
Show Gist options
  • Save qiyuangong/dc70ac3af6bd760dc1437c6110dcc6c6 to your computer and use it in GitHub Desktop.
Save qiyuangong/dc70ac3af6bd760dc1437c6110dcc6c6 to your computer and use it in GitHub Desktop.
Temp UDAction.java
package org.smartdata.server.actions;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.DFSClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smartdata.common.actions.ActionType;
import java.util.UUID;
/**
*
*/
public class UDAction implements Action {
private static final Logger LOG = LoggerFactory.getLogger(UDAction.class);
public String storagePolicy;
private String fileName;
private Configuration conf;
private DFSClient dfsClient;
private String name = "UDAction";
public UDAction() {
}
public String getName() {
return name;
}
public Action initial(DFSClient client, Configuration conf, String[] args) {
this.dfsClient = client;
this.conf = conf;
this.fileName = args[0];
this.storagePolicy = args[1];
return this;
}
public UUID run() {
for (int i = 10; i> 0; i--) {
LOG.info("User Defined Action {}", name);
}
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment