本文整理了Java中org.apache.hadoop.hbase.client.Put.size()
方法的一些代码示例,展示了Put.size()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Put.size()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Put
类名称:Put
方法名:size
暂无
代码示例来源:origin: apache/hive
@Override
public void write(final DataOutput out)
throws IOException {
ProtobufUtil.toMutationNoData(MutationType.PUT, put).writeDelimitedTo(DataOutputOutputStream.from(out));
out.writeInt(put.size());
CellScanner scanner = put.cellScanner();
while(scanner.advance()) {
KeyValue kv = KeyValueUtil.ensureKeyValue(scanner.current());
KeyValue.write(kv, out);
}
}
}
代码示例来源:origin: apache/hbase
if (put != null && put.size() >= sourceTableHash.scanBatch) {
context.write(new ImmutableBytesWritable(rowKey), put);
put = null;
代码示例来源:origin: apache/hbase
put.addColumn(CONTENTS_FAMILY, null, value);
assertEquals(1, put.size());
assertEquals(1, put.getFamilyCellMap().get(CONTENTS_FAMILY).size());
代码示例来源:origin: apache/hbase
public void prepareTestData() throws Exception {
try {
util.getAdmin().disableTable(TABLE);
util.getAdmin().deleteTable(TABLE);
} catch (Exception e) {
// ignore table not found
}
table = util.createTable(TABLE, FAM);
{
Put put = new Put(ROW);
put.addColumn(FAM, A, Bytes.add(B, C)); // B, C are friends of A
put.addColumn(FAM, B, Bytes.add(D, E, F)); // D, E, F are friends of B
put.addColumn(FAM, C, G); // G is a friend of C
table.put(put);
rowSize = put.size();
}
Put put = new Put(ROW2);
put.addColumn(FAM, D, E);
put.addColumn(FAM, F, G);
table.put(put);
row2Size = put.size();
}
代码示例来源:origin: apache/phoenix
private int comparePuts(Put p1, Put p2) {
int p1Size = p1.size();
int p2Size = p2.size();
int compare = p1Size - p2Size;
if (compare == 0) {
// TODO: make this a real comparison
// this is a little cheating, but we don't really need to worry too much about this being
// the same - chances are that exact matches here are really the same update.
return Longs.compare(p1.heapSize(), p2.heapSize());
}
return compare;
}
代码示例来源:origin: forcedotcom/phoenix
private int comparePuts(Put p1, Put p2) {
int p1Size = p1.size();
int p2Size = p2.size();
int compare = p1Size - p2Size;
if (compare == 0) {
// TODO: make this a real comparison
// this is a little cheating, but we don't really need to worry too much about this being
// the same - chances are that exact matches here are really the same update.
return Longs.compare(p1.heapSize(), p2.heapSize());
}
return compare;
}
代码示例来源:origin: apache/hbase
"only contains " + put.size(), put.size() == numColsPerRow);
ht.put(put);
代码示例来源:origin: larsgeorge/hbase-book
public static void main(String[] args) throws Exception {
// vv FingerprintExample
Put put = new Put(Bytes.toBytes("testrow"));
put.addColumn(Bytes.toBytes("fam-1"), Bytes.toBytes("qual-1"),
Bytes.toBytes("val-1"));
put.addColumn(Bytes.toBytes("fam-1"), Bytes.toBytes("qual-2"),
Bytes.toBytes("val-2"));
put.addColumn(Bytes.toBytes("fam-2"), Bytes.toBytes("qual-3"),
Bytes.toBytes("val-3"));
String id = String.format("Hostname: %s, App: %s",
InetAddress.getLocalHost().getHostName(),
System.getProperty("sun.java.command"));
put.setId(id);
System.out.println("Put.size: " + put.size());
System.out.println("Put.id: " + put.getId());
System.out.println("Put.fingerprint: " + put.getFingerprint());
System.out.println("Put.toMap: " + put.toMap());
System.out.println("Put.toJSON: " + put.toJSON());
System.out.println("Put.toString: " + put.toString());
// ^^ FingerprintExample
}
}
代码示例来源:origin: org.cloudgraph/cloudgraph-hbase
@Override
public Mutations getWriteOperations() {
List<Row> rows = new ArrayList<>(2);
// if any qualifiers
if (this.row != null && this.row.size() > 0)
rows.add(this.row);
// for delete , can be just the oper with no qualifiers
if (this.delete != null)
rows.add(this.delete);
if (this.increment != null)
rows.add(this.increment);
return new Mutations(rows, this.qualifierMap);
}
代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core
private int comparePuts(Put p1, Put p2) {
int p1Size = p1.size();
int p2Size = p2.size();
int compare = p1Size - p2Size;
if (compare == 0) {
// TODO: make this a real comparison
// this is a little cheating, but we don't really need to worry too much about this being
// the same - chances are that exact matches here are really the same update.
return Longs.compare(p1.heapSize(), p2.heapSize());
}
return compare;
}
代码示例来源:origin: org.apache.phoenix/phoenix-core
private int comparePuts(Put p1, Put p2) {
int p1Size = p1.size();
int p2Size = p2.size();
int compare = p1Size - p2Size;
if (compare == 0) {
// TODO: make this a real comparison
// this is a little cheating, but we don't really need to worry too much about this being
// the same - chances are that exact matches here are really the same update.
return Longs.compare(p1.heapSize(), p2.heapSize());
}
return compare;
}
代码示例来源:origin: com.argonio.gora/gora-hbase
field.schema(), hcol, hcol.getQualifier());
if (put.size() > 0) {
table.put(put);
代码示例来源:origin: XiaoMi/themis
HRegion region = c.getEnvironment().getRegion();
List<KeyValue> kvs = put.getFamilyMap().get(ColumnUtil.LOCK_FAMILY_NAME);
if (kvs.size() != put.size() || kvs.size() == 0) {
throw new IOException(
"contain no-lock family kvs when do prewrite for single row transaction, put=" + put);
代码示例来源:origin: apache/gora
table.delete(delete);
if (put.size() > 0) {
table.put(put);
代码示例来源:origin: com.github.hyukjinkwon/hive-hbase-handler
@Override
public void write(final DataOutput out)
throws IOException {
ProtobufUtil.toMutationNoData(MutationType.PUT, put).writeDelimitedTo(DataOutputOutputStream.from(out));
out.writeInt(put.size());
CellScanner scanner = put.cellScanner();
while(scanner.advance()) {
KeyValue kv = KeyValueUtil.ensureKeyValue(scanner.current());
KeyValue.write(kv, out);
}
}
}
代码示例来源:origin: co.cask.hbase/hbase
} else if (obj instanceof Put) {
quantities.increment("Put", 1);
quantities.increment("KeyValue", ((Put)obj).size());
for (List<KeyValue> keyValues : ((Put)obj).getFamilyMap().values()) {
for (KeyValue kv : keyValues) {
代码示例来源:origin: org.apache.hbase/hbase-server
put.addColumn(CONTENTS_FAMILY, null, value);
assertEquals(1, put.size());
assertEquals(1, put.getFamilyCellMap().get(CONTENTS_FAMILY).size());
代码示例来源:origin: com.aliyun.hbase/alihbase-endpoint
public void prepareTestData() throws Exception {
try {
util.getAdmin().disableTable(TABLE);
util.getAdmin().deleteTable(TABLE);
} catch (Exception e) {
// ignore table not found
}
table = util.createTable(TABLE, FAM);
{
Put put = new Put(ROW);
put.addColumn(FAM, A, Bytes.add(B, C)); // B, C are friends of A
put.addColumn(FAM, B, Bytes.add(D, E, F)); // D, E, F are friends of B
put.addColumn(FAM, C, G); // G is a friend of C
table.put(put);
rowSize = put.size();
}
Put put = new Put(ROW2);
put.addColumn(FAM, D, E);
put.addColumn(FAM, F, G);
table.put(put);
row2Size = put.size();
}
代码示例来源:origin: org.apache.hbase/hbase-endpoint
public void prepareTestData() throws Exception {
try {
util.getAdmin().disableTable(TABLE);
util.getAdmin().deleteTable(TABLE);
} catch (Exception e) {
// ignore table not found
}
table = util.createTable(TABLE, FAM);
{
Put put = new Put(ROW);
put.addColumn(FAM, A, Bytes.add(B, C)); // B, C are friends of A
put.addColumn(FAM, B, Bytes.add(D, E, F)); // D, E, F are friends of B
put.addColumn(FAM, C, G); // G is a friend of C
table.put(put);
rowSize = put.size();
}
Put put = new Put(ROW2);
put.addColumn(FAM, D, E);
put.addColumn(FAM, F, G);
table.put(put);
row2Size = put.size();
}
代码示例来源:origin: opencb/opencga
add(put, releaseColumn, true);
int size = put.size();
put = convert(variant, put, null);
if (size == put.size()) {
return null;
} else {
内容来源于网络,如有侵权,请联系作者删除!