本文整理了Java中org.apache.hadoop.hbase.client.Increment.getRow()
方法的一些代码示例,展示了Increment.getRow()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Increment.getRow()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Increment
类名称:Increment
方法名:getRow
[英]Method for retrieving the increment's row
[中]用于检索增量行的方法
代码示例来源:origin: apache/hbase
/**
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
* No replacement.
*/
@Deprecated
@Override
public int hashCode() {
// TODO: This is wrong. Can't have two gets the same just because on same row. But it
// matches how equals works currently and gets rid of the findbugs warning.
return Bytes.hashCode(this.getRow());
}
代码示例来源:origin: apache/flume
Maps.newTreeMap(Bytes.BYTES_COMPARATOR);
for (Increment inc : incs) {
byte[] row = inc.getRow();
Map<byte[], NavigableMap<byte[], Long>> families = getFamilyMap(inc);
for (Map.Entry<byte[], NavigableMap<byte[], Long>> familyEntry : families.entrySet()) {
代码示例来源:origin: apache/flume
Maps.newTreeMap(Bytes.BYTES_COMPARATOR);
for (Increment inc : incs) {
byte[] row = inc.getRow();
Map<byte[], NavigableMap<byte[], Long>> families = getFamilyMap(inc);
for (Map.Entry<byte[], NavigableMap<byte[], Long>> familyEntry : families.entrySet()) {
代码示例来源:origin: apache/hbase
private static Cell createCustomCell(Increment inc) {
return createCustomCell(inc.getRow(), FAMILY, QUALIFIER_FROM_CP, Cell.Type.Put, VALUE);
}
代码示例来源:origin: apache/hbase
@Override
public Result increment(final Increment increment) throws IOException {
checkHasFamilies(increment);
NoncedRegionServerCallable<Result> callable =
new NoncedRegionServerCallable<Result>(this.connection, getName(), increment.getRow(),
this.rpcControllerFactory.newController(), increment.getPriority()) {
@Override
protected Result rpcCall() throws Exception {
MutateRequest request = RequestConverter.buildMutateRequest(
getLocation().getRegionInfo().getRegionName(), increment, getNonceGroup(), getNonce());
MutateResponse response = doMutate(request);
// Should this check for null like append does?
return ProtobufUtil.toResult(response.getResult(), getRpcControllerCellScanner());
}
};
return rpcCallerFactory.<Result> newCaller(writeRpcTimeoutMs).callWithRetries(callable,
this.operationTimeoutMs);
}
代码示例来源:origin: apache/hbase
public static TIncrement incrementFromHBase(Increment in) throws IOException {
TIncrement out = new TIncrement();
out.setRow(in.getRow());
代码示例来源:origin: apache/hbase
@Override
public Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> c, Increment increment)
throws IOException {
byte[] row = increment.getRow();
Put put = new Put(row);
long ts = getUniqueTimestamp(row);
for (Map.Entry<byte[], List<Cell>> entry : increment.getFamilyCellMap().entrySet()) {
for (Cell cell : entry.getValue()) {
put.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setRow(row)
.setFamily(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength())
.setQualifier(cell.getQualifierArray(), cell.getQualifierOffset(),
cell.getQualifierLength())
.setValue(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())
.setType(Cell.Type.Put).setTimestamp(ts).build());
}
}
c.getEnvironment().getRegion().put(put);
c.bypass();
return Result.EMPTY_RESULT;
}
代码示例来源:origin: apache/hbase
@Test
public void testIncrementCopyConstructor() throws IOException {
Increment origin = new Increment(Bytes.toBytes("ROW-01"));
origin.setPriority(100);
byte[] family = Bytes.toBytes("CF-01");
origin.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
.setRow(origin.getRow())
.setFamily(family)
.setQualifier(Bytes.toBytes("q"))
.setType(Cell.Type.Put)
.setValue(Bytes.toBytes(100))
.build());
origin.addColumn(family, Bytes.toBytes("q0"), 4);
origin.setTimeRange(100, 1000);
Increment clone = new Increment(origin);
assertEquals(origin, clone);
origin.addColumn(family, Bytes.toBytes("q1"), 3);
//They should have different cell lists
assertNotEquals(origin.getCellList(family), clone.getCellList(family));
}
代码示例来源:origin: org.apache.hbase/hbase-client
/**
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
* No replacement.
*/
@Deprecated
@Override
public int hashCode() {
// TODO: This is wrong. Can't have two gets the same just because on same row. But it
// matches how equals works currently and gets rid of the findbugs warning.
return Bytes.hashCode(this.getRow());
}
代码示例来源:origin: apache/phoenix
private static List<Mutation> convertIncrementToPutInSingletonList(Increment inc) {
byte[] rowKey = inc.getRow();
Put put = new Put(rowKey);
transferCells(inc, put);
transferAttributes(inc, put);
return Collections.<Mutation>singletonList(put);
}
代码示例来源:origin: apache/hbase
@Override
public Result preIncrementAfterRowLock(final ObserverContext<RegionCoprocessorEnvironment> c,
final Increment increment) throws IOException {
if (increment.getAttribute(CHECK_COVERING_PERM) != null) {
// We had failure with table, cf and q perm checks and now giving a chance for cell
// perm check
TableName table = c.getEnvironment().getRegion().getRegionInfo().getTable();
AuthResult authResult = null;
User user = getActiveUser(c);
if (checkCoveringPermission(user, OpType.INCREMENT, c.getEnvironment(), increment.getRow(),
increment.getFamilyCellMap(), increment.getTimeRange().getMax(), Action.WRITE)) {
authResult = AuthResult.allow(OpType.INCREMENT.toString(), "Covering cell set",
user, Action.WRITE, table, increment.getFamilyCellMap());
} else {
authResult = AuthResult.deny(OpType.INCREMENT.toString(), "Covering cell set",
user, Action.WRITE, table, increment.getFamilyCellMap());
}
AccessChecker.logResult(authResult);
if (authorizationEnabled && !authResult.isAllowed()) {
throw new AccessDeniedException("Insufficient permissions " +
authResult.toContextString());
}
}
return null;
}
代码示例来源:origin: org.apache.hbase/hbase-client
@Override
public Result increment(final Increment increment) throws IOException {
checkHasFamilies(increment);
NoncedRegionServerCallable<Result> callable =
new NoncedRegionServerCallable<Result>(this.connection, getName(), increment.getRow(),
this.rpcControllerFactory.newController(), increment.getPriority()) {
@Override
protected Result rpcCall() throws Exception {
MutateRequest request = RequestConverter.buildMutateRequest(
getLocation().getRegionInfo().getRegionName(), increment, getNonceGroup(), getNonce());
MutateResponse response = doMutate(request);
// Should this check for null like append does?
return ProtobufUtil.toResult(response.getResult(), getRpcControllerCellScanner());
}
};
return rpcCallerFactory.<Result> newCaller(writeRpcTimeoutMs).callWithRetries(callable,
this.operationTimeoutMs);
}
代码示例来源:origin: apache/phoenix
"Unable to process ON DUPLICATE IGNORE for " +
e.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString() +
"(" + Bytes.toStringBinary(inc.getRow()) + ")", t);
} finally {
long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
代码示例来源:origin: apache/phoenix
byte[] rowKey = inc.getRow();
final Get get = new Get(rowKey);
if (isDupKeyIgnore(opBytes)) {
代码示例来源:origin: org.apache.hbase/hbase-client
@Test
public void testIncrementCopyConstructor() throws IOException {
Increment origin = new Increment(Bytes.toBytes("ROW-01"));
origin.setPriority(100);
byte[] family = Bytes.toBytes("CF-01");
origin.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
.setRow(origin.getRow())
.setFamily(family)
.setQualifier(Bytes.toBytes("q"))
.setType(Cell.Type.Put)
.setValue(Bytes.toBytes(100))
.build());
origin.addColumn(family, Bytes.toBytes("q0"), 4);
origin.setTimeRange(100, 1000);
Increment clone = new Increment(origin);
assertEquals(origin, clone);
origin.addColumn(family, Bytes.toBytes("q1"), 3);
//They should have different cell lists
assertNotEquals(origin.getCellList(family), clone.getCellList(family));
}
代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core
private static List<Mutation> convertIncrementToPutInSingletonList(Increment inc) {
byte[] rowKey = inc.getRow();
Put put = new Put(rowKey);
transferCells(inc, put);
transferAttributes(inc, put);
return Collections.<Mutation>singletonList(put);
}
代码示例来源:origin: forcedotcom/phoenix
e.complete();
HRegion region = env.getRegion();
byte[] row = increment.getRow();
TimeRange tr = increment.getTimeRange();
region.startRegionOperation();
代码示例来源:origin: apache/phoenix
byte[] row = increment.getRow();
List<RowLock> locks = Lists.newArrayList();
TimeRange tr = increment.getTimeRange();
代码示例来源:origin: co.cask.hbase/hbase
@Override
public int compareTo(Row i) {
return Bytes.compareTo(this.getRow(), i.getRow());
}
}
代码示例来源:origin: cdapio/cdap
@Override
public IncrementBuilder add(byte[] family, byte[] qualifier, long ts, long value) throws IOException {
increment.add(new KeyValue(increment.getRow(), family, qualifier, ts, Bytes.toBytes(value)));
return this;
}
内容来源于网络,如有侵权,请联系作者删除!