本文整理匯總了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);
}
}
}
}
示例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);
}
}
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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;