ROdps { public void writeTableFromDT(String projectName, String tableName, String partition, String dataFilePathName, String columnDelimiter, String rowDelimiter, long recordCount, int threadNumber) throws ROdpsException { int retryTimes = 0; while (true) { try { LOG.info("before create RDTUploader"); if (projectName == null) { projectName = this.ODPS_PROJECT_NAME; } if (partition != null) { partition = formatPartition(partition, "", ","); } Context<UploadSession> context = new Context<UploadSession>(odps, DT_ENDPOINT, projectName, tableName, partition, -1, columnDelimiter, rowDelimiter, threadNumber); context.setRecordCount(recordCount); RDTUploader uploader = new RDTUploader(context); uploader.upload(dataFilePathName); return; } catch (IOException e) { if (++retryTimes <= RETRY_MAX) { LOG.error("write table encounter exception:" + e.getMessage() + ", retry times = " + retryTimes); try { Thread.sleep(5000); } catch (InterruptedException e1) { LOG.error("Sleep interrupted!", e1); } continue; } throw new ROdpsException(e); } catch (Exception e) { throw new ROdpsException(e); } } } ROdps(String projectName, String accessID, String accessKey, String endPoint,
      String dtEndpoint, String logviewHost, String log4j_properties); void setBizId(String s); void set(String key, String value); void unset(String key); void writeTableFromDT(String projectName, String tableName, String partition,
      String dataFilePathName, String columnDelimiter, String rowDelimiter, long recordCount,
      int threadNumber); List<List<String>> loadTableFromDT(String projectName, String tableName, String partition,
      String tempFile, String colDelimiter, String rowDelimiter, int limit, int threadNumber); boolean useProject(String projectName); String getProjectName(String projectName); long getTableSize(String projectName, String tableName, String partition); List<DataFrameItem> describeTable(String projectName, String tableName, String partition); boolean dropTable(String projectName, String tableName); boolean isTableExist(String projectName, String tableName, String partition); String getTableSchemaJson(String projectName, String tableName); int getIndexFromColName(String colName, String tableSchemaJson); List<String> runSqlTask(String sql); List<DataFrameItem> getTables(String projectName, String pattern); static String formatPartition(String part, String valueDim, String fieldDim); boolean setLogPath(String log_path);  }
@Test public void testUpload() throws ROdpsException { String project = null; String partition = null; String colDelimiter = "\u0001"; String rowDelimiter = "\n"; rodps.writeTableFromDT(project, table, partition, file, colDelimiter, rowDelimiter, 1, 8); }