/** * Get versions of columns with the specified timestamp. * @param timestamp version timestamp * @return this for invocation chaining * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link #setTimestamp(long)} instead */ @Deprecated public Get setTimeStamp(long timestamp) throws IOException { return this.setTimestamp(timestamp); }
protected void assertResultEquals(final HRegion region, final byte [] row, final byte [] family, final byte [] qualifier, final long timestamp, final byte [] value) throws IOException { Get get = new Get(row); get.setTimestamp(timestamp); Result res = region.get(get); NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> map = res.getMap(); byte [] res_value = map.get(family).get(qualifier).get(timestamp); if (value == null) { assertEquals(Bytes.toString(family) + " " + Bytes.toString(qualifier) + " at timestamp " + timestamp, null, res_value); } else { if (res_value == null) { fail(Bytes.toString(family) + " " + Bytes.toString(qualifier) + " at timestamp " + timestamp + "\" was expected to be \"" + Bytes.toStringBinary(value) + " but was null"); } if (res_value != null) { assertEquals(Bytes.toString(family) + " " + Bytes.toString(qualifier) + " at timestamp " + timestamp, value, new String(res_value, StandardCharsets.UTF_8)); } } }
private void getVersionAndVerify(Table ht, byte [] row, byte [] family, byte [] qualifier, long stamp, byte [] value) throws Exception { Get get = new Get(row); get.addColumn(family, qualifier); get.setTimestamp(stamp); get.setMaxVersions(Integer.MAX_VALUE); Result result = ht.get(get); assertSingleResult(result, row, family, qualifier, stamp, value); }
private void getVersionAndVerifyMissing(Table ht, byte [] row, byte [] family, byte [] qualifier, long stamp) throws Exception { Get get = new Get(row); get.addColumn(family, qualifier); get.setTimestamp(stamp); get.setMaxVersions(Integer.MAX_VALUE); Result result = ht.get(get); assertEmptyResult(result); }
@Test public void testRecoverStandby() throws IOException, StreamLacksCapabilityException { setupSyncReplicationWALs(); long procId = procExec.submitProcedure(new RecoverStandbyProcedure(PEER_ID, false)); ProcedureTestingUtility.waitProcedure(procExec, procId); ProcedureTestingUtility.assertProcNotFailed(procExec, procId); try (Table table = UTIL.getConnection().getTable(tableName)) { for (int i = 0; i < WAL_NUMBER * ROW_COUNT; i++) { Result result = table.get(new Get(Bytes.toBytes(i)).setTimestamp(timestamp)); assertNotNull(result); assertEquals(i, Bytes.toInt(result.getValue(family, qualifier))); } } }
/** * Get versions of columns with the specified timestamp. * @param timestamp version timestamp * @return this for invocation chaining * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link #setTimestamp(long)} instead */ @Deprecated public Get setTimeStamp(long timestamp) throws IOException { return this.setTimestamp(timestamp); }
get.addFamily(FAMILYA); get.addFamily(FAMILYB); get.setTimestamp(TS_1); result = table.get(get); value1 = result.getValue(FAMILYA, QUALIFIER_1);
get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); get.setTimestamp(TS_1); result = remoteTable.get(get); value1 = result.getValue(COLUMN_1, QUALIFIER_1);
Get get = new Get(rows[i]); get.addFamily(HConstants.CATALOG_FAMILY); get.setTimestamp(timestamp[j]); Result result = table.get(get); int cellCount = 0;
out.setTimestamp(in.getTimestamp()); } else if (in.isSetTimeRange()) { out.setTimeRange(in.getTimeRange().getMinStamp(), in.getTimeRange().getMaxStamp());
/** * Get versions of columns with the specified timestamp. * @param timestamp version timestamp * @return this for invocation chaining * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link #setTimestamp(long)} instead */ @Deprecated public Get setTimeStamp(long timestamp) throws IOException { return this.setTimestamp(timestamp); }
protected void assertResultEquals(final HRegion region, final byte [] row, final byte [] family, final byte [] qualifier, final long timestamp, final byte [] value) throws IOException { Get get = new Get(row); get.setTimestamp(timestamp); Result res = region.get(get); NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> map = res.getMap(); byte [] res_value = map.get(family).get(qualifier).get(timestamp); if (value == null) { assertEquals(Bytes.toString(family) + " " + Bytes.toString(qualifier) + " at timestamp " + timestamp, null, res_value); } else { if (res_value == null) { fail(Bytes.toString(family) + " " + Bytes.toString(qualifier) + " at timestamp " + timestamp + "\" was expected to be \"" + Bytes.toStringBinary(value) + " but was null"); } if (res_value != null) { assertEquals(Bytes.toString(family) + " " + Bytes.toString(qualifier) + " at timestamp " + timestamp, value, new String(res_value, StandardCharsets.UTF_8)); } } }
private void getVersionAndVerify(Table ht, byte [] row, byte [] family, byte [] qualifier, long stamp, byte [] value) throws Exception { Get get = new Get(row); get.addColumn(family, qualifier); get.setTimestamp(stamp); get.setMaxVersions(Integer.MAX_VALUE); Result result = ht.get(get); assertSingleResult(result, row, family, qualifier, stamp, value); }
private void getVersionAndVerifyMissing(Table ht, byte [] row, byte [] family, byte [] qualifier, long stamp) throws Exception { Get get = new Get(row); get.addColumn(family, qualifier); get.setTimestamp(stamp); get.setMaxVersions(Integer.MAX_VALUE); Result result = ht.get(get); assertEmptyResult(result); }
get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); get.setTimestamp(TS_1); result = remoteTable.get(get); value1 = result.getValue(COLUMN_1, QUALIFIER_1);
Get get = new Get(rows[i]); get.addFamily(HConstants.CATALOG_FAMILY); get.setTimestamp(timestamp[j]); Result result = table.get(get); int cellCount = 0;
out.setTimestamp(in.getTimestamp()); } else if (in.isSetTimeRange()) { out.setTimeRange(in.getTimeRange().getMinStamp(), in.getTimeRange().getMaxStamp());
out.setTimestamp(in.getTimestamp()); } else if (in.isSetTimeRange()) { out.setTimeRange(in.getTimeRange().getMinStamp(), in.getTimeRange().getMaxStamp());