Last active
May 27, 2017 13:32
-
-
Save qiyuangong/dc70ac3af6bd760dc1437c6110dcc6c6 to your computer and use it in GitHub Desktop.
Temp UDAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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