@Override @Before public void setUp() { Account account = new AliyunAccount(ACCESS_ID, ACCESS_KEY); odps = new Odps(account); odps.setDefaultProject(PROJECT); odps.setEndpoint(ENDPOINT); super.setUp(); }
public static void main(String[] args) throws Exception { String testDateYmd = "20140102"; String extraPartitions = ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); MapreduceConfigInfo conf = parseConfig(extraPartitions); JobConf job = makeMapreduceJobConf(conf, sdf.parse(testDateYmd)); if (job == null) { throw new Exception("Create mapreduce job failed"); } Account account = new AliyunAccount("x", "x"); Odps odps = new Odps(account); odps.setDefaultProject("local"); SessionState sessionState = SessionState.get(); sessionState.setLocalRun(true); sessionState.setOdps(odps); JobClient.runJob(job); }