當前位置: 首頁>>代碼示例>>Java>>正文


Java FieldMappable類代碼示例

本文整理匯總了Java中com.cloudera.sqoop.lib.FieldMappable的典型用法代碼示例。如果您正苦於以下問題:Java FieldMappable類的具體用法?Java FieldMappable怎麽用?Java FieldMappable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FieldMappable類屬於com.cloudera.sqoop.lib包,在下文中一共展示了FieldMappable類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: accept

import com.cloudera.sqoop.lib.FieldMappable; //導入依賴的package包/類
@Override
/**
 * Processes a record by extracting its field map and converting
 * it into a list of Mutations into Accumulo.
 */
public void accept(FieldMappable record)
    throws IOException, ProcessingException {
  Map<String, Object> fields = record.getFieldMap();

  Iterable<Mutation> putList = mutationTransformer.getMutations(fields);
  if (null != putList) {
    for (Mutation m : putList) {
      try {
        this.table.addMutation(m);
      } catch (MutationsRejectedException ex) {
        throw new IOException("Mutation rejected" , ex);
      }
    }
  }
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:21,代碼來源:AccumuloMutationProcessor.java

示例2: accept

import com.cloudera.sqoop.lib.FieldMappable; //導入依賴的package包/類
@Override
/**
 * Processes a record by extracting its field map and converting
 * it into a list of Put commands into HBase.
 */
public void accept(FieldMappable record)
    throws IOException, ProcessingException {
  Map<String, Object> fields = record.getFieldMap();

  List<Put> putList = putTransformer.getPutCommand(fields);
  if (null != putList) {
    for (Put put : putList) {
      if (put!=null) {
        if (put.isEmpty()) {
          LOG.warn("Could not insert row with no columns "
              + "for row-key column: " + Bytes.toString(put.getRow()));
        } else {
          this.table.put(put);
        }
      }
    }
  }
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:24,代碼來源:HBasePutProcessor.java

示例3: accept

import com.cloudera.sqoop.lib.FieldMappable; //導入依賴的package包/類
@Override
public void accept(FieldMappable record) throws IOException,
        ProcessingException {
  Map<String, Object> fields = record.getFieldMap();
  OdpsRowDO rowDO = new OdpsRowDO();
  try {
    rowDO.setRecord(odpsRecordBuilder.buildRecord(fields));
    String partitionSpec = getPartitionSpec(partitionKeys,
            partitionValues, fields);
    rowDO.setPartitionSpec(partitionSpec);
    rowDOList.add(rowDO);
    if (rowDOList.size() >= batchSize) {
      sendBatch(rowDOList);
    }
  } catch (Exception e) {
    throw new ProcessingException(e);
  }
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:19,代碼來源:OdpsUploadProcessor.java

示例4: accept

import com.cloudera.sqoop.lib.FieldMappable; //導入依賴的package包/類
@Override
/**
 * Processes a record by extracting its field map and converting
 * it into a list of Put commands into HBase.
 */
public void accept(FieldMappable record)
    throws IOException, ProcessingException {
  Map<String, Object> fields = record.getFieldMap();

  List<Put> putList = putTransformer.getPutCommand(fields);
  if (null != putList) {
    for (Put put : putList) {
      this.table.put(put);
    }
  }
}
 
開發者ID:infinidb,項目名稱:sqoop,代碼行數:17,代碼來源:HBasePutProcessor.java

示例5: accept

import com.cloudera.sqoop.lib.FieldMappable; //導入依賴的package包/類
/**
 * Allow arbitrary processing of a FieldMappable object.
 * @param record an object which can emit a map of its field names to values.
 * @throws IOException if the processor encounters an IO error when
 * operating on this object.
 * @throws ProcessingException if the FieldMapProcessor encounters
 * a general processing error when operating on this object.
 */
void accept(FieldMappable record) throws IOException, ProcessingException;
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:10,代碼來源:FieldMapProcessor.java


注:本文中的com.cloudera.sqoop.lib.FieldMappable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。