/** * Returns a new {@link org.apache.hadoop.conf.Configuration} instance from the HBase version-specific factory. */ @Override public Configuration get() { return provider.get(); }
/** * Invoked by jsvc to initialize the program. */ public void init(String[] args) { if (conf == null) { conf = new ConfigurationFactory().get(); } }
/** * Returns the timestamp for calculating time to live for the given cell timestamp. * This takes into account pre-existing non-transactional cells while calculating the time. */ public static long getTimestampForTTL(long cellTs) { return isPreExistingVersion(cellTs) ? cellTs * TxConstants.MAX_TX_PER_MS : cellTs; }
/** * Prints out the HBase {@link Version} enum value for the current version of HBase on the classpath. */ public static void main(String[] args) { boolean verbose = args.length == 1 && "-v".equals(args[0]); Version version = HBaseVersion.get(); System.out.println(version.getMajorVersion()); if (verbose) { System.out.println("versionString=" + getVersionString()); } }
@Test public void testVersionFactory() { HBaseVersion.Version foundVersion = HBaseVersion.get(); assertEquals(getExpectedVersion(), foundVersion); }
/** * Returns the oldest visible timestamp for the given transaction, based on the TTLs configured for each column * family. If no TTL is set on any column family, the oldest visible timestamp will be {@code 0}. * @param ttlByFamily A map of column family name to TTL value (in milliseconds) * @param tx The current transaction * @return The oldest timestamp that will be visible for the given transaction and TTL configuration */ public static long getOldestVisibleTimestamp(Map<byte[], Long> ttlByFamily, Transaction tx) { long maxTTL = getMaxTTL(ttlByFamily); // we know that data will not be cleaned up while this tx is running up to this point as janitor uses it return maxTTL < Long.MAX_VALUE ? tx.getVisibilityUpperBound() - maxTTL * TxConstants.MAX_TX_PER_MS : 0; }
/** * Invoked by jsvc to initialize the program. */ public void init(String[] args) { if (conf == null) { conf = new ConfigurationFactory().get(); } }
/** * Returns the timestamp for calculating time to live for the given cell timestamp. * This takes into account pre-existing non-transactional cells while calculating the time. */ public static long getTimestampForTTL(long cellTs) { return isPreExistingVersion(cellTs) ? cellTs * TxConstants.MAX_TX_PER_MS : cellTs; }
/** * Prints out the HBase {@link Version} enum value for the current version of HBase on the classpath. */ public static void main(String[] args) { boolean verbose = args.length == 1 && "-v".equals(args[0]); Version version = HBaseVersion.get(); System.out.println(version.getMajorVersion()); if (verbose) { System.out.println("versionString=" + getVersionString()); } }
/** * Returns a new {@link org.apache.hadoop.conf.Configuration} instance from the HBase version-specific factory. * * @param baseConf additional configuration properties to merge on to the classpath configuration * @return the merged configuration */ public Configuration get(Configuration baseConf) { return provider.get(baseConf); } }
/** * Returns the oldest visible timestamp for the given transaction, based on the TTLs configured for each column * family. If no TTL is set on any column family, the oldest visible timestamp will be {@code 0}. * @param ttlByFamily A map of column family name to TTL value (in milliseconds) * @param tx The current transaction * @return The oldest timestamp that will be visible for the given transaction and TTL configuration */ public static long getOldestVisibleTimestamp(Map<byte[], Long> ttlByFamily, Transaction tx) { long maxTTL = getMaxTTL(ttlByFamily); // we know that data will not be cleaned up while this tx is running up to this point as janitor uses it return maxTTL < Long.MAX_VALUE ? tx.getVisibilityUpperBound() - maxTTL * TxConstants.MAX_TX_PER_MS : 0; }
public BalanceBooks(int totalClients, int iterations) { this(totalClients, iterations, new ConfigurationFactory().get()); }
private boolean isColumnDelete(Cell cell) { return !TxUtils.isPreExistingVersion(cell.getTimestamp()) && cell.getValueLength() == 0 && !allowEmptyValues; }
/** * Returns a new {@link org.apache.hadoop.conf.Configuration} instance from the HBase version-specific factory. */ @Override public Configuration get() { return provider.get(); }
public BalanceBooks(int totalClients, int iterations) { this(totalClients, iterations, new ConfigurationFactory().get()); }
private boolean isColumnDelete(Cell cell) { return !TxUtils.isPreExistingVersion(cell.getTimestamp()) && cell.getValueLength() == 0 && !allowEmptyValues; }
/** * Returns a new {@link org.apache.hadoop.conf.Configuration} instance from the HBase version-specific factory. * * @param baseConf additional configuration properties to merge on to the classpath configuration * @return the merged configuration */ public Configuration get(Configuration baseConf) { return provider.get(baseConf); } }
protected Configuration getSnapshotConfiguration() throws IOException { Configuration conf = new ConfigurationFactory().get(hConf); conf.unset(TxConstants.Persist.CFG_TX_SNAPHOT_CODEC_CLASSES); return conf; }
private boolean isColumnDelete(Cell cell) { return !TxUtils.isPreExistingVersion(cell.getTimestamp()) && cell.getValueLength() == 0 && !allowEmptyValues; }
protected Configuration getSnapshotConfiguration() throws IOException { Configuration conf = new ConfigurationFactory().get(hConf); conf.unset(TxConstants.Persist.CFG_TX_SNAPHOT_CODEC_CLASSES); return conf; }