Java Code Examples for org.apache.hadoop.hbase.regionserver.ScanType#COMPACT_DROP_DELETES

The following examples show how to use org.apache.hadoop.hbase.regionserver.ScanType#COMPACT_DROP_DELETES . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransactionVisibilityFilter.java    From phoenix-tephra with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link org.apache.hadoop.hbase.filter.Filter} for returning data only from visible transactions.
 *
 * @param tx the current transaction to apply.  Only data visible to this transaction will be returned.
 * @param ttlByFamily map of time-to-live (TTL) (in milliseconds) by column family name
 * @param allowEmptyValues if {@code true} cells with empty {@code byte[]} values will be returned, if {@code false}
 *                         these will be interpreted as "delete" markers and the column will be filtered out
 * @param scanType the type of scan operation being performed
 * @param cellFilter if non-null, this filter will be applied to all cells visible to the current transaction, by
 *                   calling {@link Filter#filterKeyValue(org.apache.hadoop.hbase.Cell)}.  If null, then
 *                   {@link Filter.ReturnCode#INCLUDE_AND_NEXT_COL} will be returned instead.
 */
 public TransactionVisibilityFilter(Transaction tx, Map<byte[], Long> ttlByFamily, boolean allowEmptyValues,
                             ScanType scanType, @Nullable Filter cellFilter) {
  this.tx = tx;
  this.oldestTsByFamily = Maps.newTreeMap();
  for (Map.Entry<byte[], Long> ttlEntry : ttlByFamily.entrySet()) {
    long familyTTL = ttlEntry.getValue();
    oldestTsByFamily.put(new ImmutableBytesWritable(ttlEntry.getKey()),
                         familyTTL <= 0 ? 0 : tx.getVisibilityUpperBound() - familyTTL * TxConstants.MAX_TX_PER_MS);
  }
  this.allowEmptyValues = allowEmptyValues;
  this.clearDeletes =
    scanType == ScanType.COMPACT_DROP_DELETES ||
      (scanType == ScanType.USER_SCAN && tx.getVisibilityLevel() != Transaction.VisibilityLevel.SNAPSHOT_ALL);
  this.cellFilter = cellFilter;
}
 
Example 2
Source File: TransactionVisibilityFilter.java    From phoenix-tephra with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link Filter} for returning data only from visible transactions.
 *
 * @param tx the current transaction to apply.  Only data visible to this transaction will be returned.
 * @param ttlByFamily map of time-to-live (TTL) (in milliseconds) by column family name
 * @param allowEmptyValues if {@code true} cells with empty {@code byte[]} values will be returned, if {@code false}
 *                         these will be interpreted as "delete" markers and the column will be filtered out
 * @param scanType the type of scan operation being performed
 * @param cellFilter if non-null, this filter will be applied to all cells visible to the current transaction, by
 *                   calling {@link Filter#filterKeyValue(org.apache.hadoop.hbase.Cell)}.  If null, then
 *                   {@link Filter.ReturnCode#INCLUDE_AND_NEXT_COL} will be returned instead.
 */
 public TransactionVisibilityFilter(Transaction tx, Map<byte[], Long> ttlByFamily, boolean allowEmptyValues,
                             ScanType scanType, @Nullable Filter cellFilter) {
  this.tx = tx;
  this.oldestTsByFamily = Maps.newTreeMap(Bytes.BYTES_COMPARATOR);
  for (Map.Entry<byte[], Long> ttlEntry : ttlByFamily.entrySet()) {
    long familyTTL = ttlEntry.getValue();
    oldestTsByFamily.put(ttlEntry.getKey(),
                         familyTTL <= 0 ? 0 : tx.getVisibilityUpperBound() - familyTTL * TxConstants.MAX_TX_PER_MS);
  }
  this.allowEmptyValues = allowEmptyValues;
  this.clearDeletes =
      scanType == ScanType.COMPACT_DROP_DELETES ||
        (scanType == ScanType.USER_SCAN && tx.getVisibilityLevel() != Transaction.VisibilityLevel.SNAPSHOT_ALL);
  this.cellFilter = cellFilter;
}
 
Example 3
Source File: TransactionVisibilityFilter.java    From phoenix-tephra with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link org.apache.hadoop.hbase.filter.Filter} for returning data only from visible transactions.
 *
 * @param tx the current transaction to apply.  Only data visible to this transaction will be returned.
 * @param ttlByFamily map of time-to-live (TTL) (in milliseconds) by column family name
 * @param allowEmptyValues if {@code true} cells with empty {@code byte[]} values will be returned, if {@code false}
 *                         these will be interpreted as "delete" markers and the column will be filtered out
 * @param scanType the type of scan operation being performed
 * @param cellFilter if non-null, this filter will be applied to all cells visible to the current transaction, by
 *                   calling {@link Filter#filterKeyValue(org.apache.hadoop.hbase.Cell)}.  If null, then
 *                   {@link Filter.ReturnCode#INCLUDE_AND_NEXT_COL} will be returned instead.
 */
 public TransactionVisibilityFilter(Transaction tx, Map<byte[], Long> ttlByFamily, boolean allowEmptyValues,
                             ScanType scanType, @Nullable Filter cellFilter) {
  this.tx = tx;
  this.oldestTsByFamily = Maps.newTreeMap();
  for (Map.Entry<byte[], Long> ttlEntry : ttlByFamily.entrySet()) {
    long familyTTL = ttlEntry.getValue();
    oldestTsByFamily.put(new ImmutableBytesWritable(ttlEntry.getKey()),
                         familyTTL <= 0 ? 0 : tx.getVisibilityUpperBound() - familyTTL * TxConstants.MAX_TX_PER_MS);
  }
  this.allowEmptyValues = allowEmptyValues;
  this.clearDeletes =
    scanType == ScanType.COMPACT_DROP_DELETES ||
      (scanType == ScanType.USER_SCAN && tx.getVisibilityLevel() != Transaction.VisibilityLevel.SNAPSHOT_ALL);
  this.cellFilter = cellFilter;
}
 
Example 4
Source File: TransactionVisibilityFilter.java    From phoenix-tephra with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link org.apache.hadoop.hbase.filter.Filter} for returning data only from visible transactions.
 *
 * @param tx the current transaction to apply.  Only data visible to this transaction will be returned.
 * @param ttlByFamily map of time-to-live (TTL) (in milliseconds) by column family name
 * @param allowEmptyValues if {@code true} cells with empty {@code byte[]} values will be returned, if {@code false}
 *                         these will be interpreted as "delete" markers and the column will be filtered out
 * @param scanType the type of scan operation being performed
 * @param cellFilter if non-null, this filter will be applied to all cells visible to the current transaction, by
 *                   calling {@link Filter#filterKeyValue(org.apache.hadoop.hbase.Cell)}.  If null, then
 *                   {@link Filter.ReturnCode#INCLUDE_AND_NEXT_COL} will be returned instead.
 */
 public TransactionVisibilityFilter(Transaction tx, Map<byte[], Long> ttlByFamily, boolean allowEmptyValues,
                             ScanType scanType, @Nullable Filter cellFilter) {
  this.tx = tx;
  this.oldestTsByFamily = Maps.newTreeMap();
  for (Map.Entry<byte[], Long> ttlEntry : ttlByFamily.entrySet()) {
    long familyTTL = ttlEntry.getValue();
    oldestTsByFamily.put(new ImmutableBytesWritable(ttlEntry.getKey()),
                         familyTTL <= 0 ? 0 : tx.getVisibilityUpperBound() - familyTTL * TxConstants.MAX_TX_PER_MS);
  }
  this.allowEmptyValues = allowEmptyValues;
  this.clearDeletes =
    scanType == ScanType.COMPACT_DROP_DELETES ||
      (scanType == ScanType.USER_SCAN && tx.getVisibilityLevel() != Transaction.VisibilityLevel.SNAPSHOT_ALL);
  this.cellFilter = cellFilter;
}
 
Example 5
Source File: TransactionVisibilityFilter.java    From phoenix-tephra with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link org.apache.hadoop.hbase.filter.Filter} for returning data only from visible transactions.
 *
 * @param tx the current transaction to apply.  Only data visible to this transaction will be returned.
 * @param ttlByFamily map of time-to-live (TTL) (in milliseconds) by column family name
 * @param allowEmptyValues if {@code true} cells with empty {@code byte[]} values will be returned, if {@code false}
 *                         these will be interpreted as "delete" markers and the column will be filtered out
 * @param scanType the type of scan operation being performed
 * @param cellFilter if non-null, this filter will be applied to all cells visible to the current transaction, by
 *                   calling {@link Filter#filterKeyValue(org.apache.hadoop.hbase.Cell)}.  If null, then
 *                   {@link Filter.ReturnCode#INCLUDE_AND_NEXT_COL} will be returned instead.
 */
public TransactionVisibilityFilter(Transaction tx, Map<byte[], Long> ttlByFamily, boolean allowEmptyValues,
                            ScanType scanType, @Nullable Filter cellFilter) {
  this.tx = tx;
  this.oldestTsByFamily = Maps.newTreeMap();
  for (Map.Entry<byte[], Long> ttlEntry : ttlByFamily.entrySet()) {
    long familyTTL = ttlEntry.getValue();
    oldestTsByFamily.put(new ImmutableBytesWritable(ttlEntry.getKey()),
                         familyTTL <= 0 ? 0 : tx.getVisibilityUpperBound() - familyTTL * TxConstants.MAX_TX_PER_MS);
  }
  this.allowEmptyValues = allowEmptyValues;
  this.clearDeletes =
    scanType == ScanType.COMPACT_DROP_DELETES ||
      (scanType == ScanType.USER_SCAN && tx.getVisibilityLevel() != Transaction.VisibilityLevel.SNAPSHOT_ALL);
  this.cellFilter = cellFilter;
}
 
Example 6
Source File: TransactionVisibilityFilter.java    From phoenix-tephra with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link org.apache.hadoop.hbase.filter.Filter} for returning data only from visible transactions.
 *
 * @param tx the current transaction to apply.  Only data visible to this transaction will be returned.
 * @param ttlByFamily map of time-to-live (TTL) (in milliseconds) by column family name
 * @param allowEmptyValues if {@code true} cells with empty {@code byte[]} values will be returned, if {@code false}
 *                         these will be interpreted as "delete" markers and the column will be filtered out
 * @param scanType the type of scan operation being performed
 * @param cellFilter if non-null, this filter will be applied to all cells visible to the current transaction, by
 *                   calling {@link Filter#filterKeyValue(org.apache.hadoop.hbase.Cell)}.  If null, then
 *                   {@link Filter.ReturnCode#INCLUDE_AND_NEXT_COL} will be returned instead.
 */
public TransactionVisibilityFilter(Transaction tx, Map<byte[], Long> ttlByFamily, boolean allowEmptyValues,
                            ScanType scanType, @Nullable Filter cellFilter) {
  this.tx = tx;
  this.oldestTsByFamily = Maps.newTreeMap();
  for (Map.Entry<byte[], Long> ttlEntry : ttlByFamily.entrySet()) {
    long familyTTL = ttlEntry.getValue();
    oldestTsByFamily.put(new ImmutableBytesWritable(ttlEntry.getKey()),
                         familyTTL <= 0 ? 0 : tx.getVisibilityUpperBound() - familyTTL * TxConstants.MAX_TX_PER_MS);
  }
  this.allowEmptyValues = allowEmptyValues;
  this.clearDeletes =
    scanType == ScanType.COMPACT_DROP_DELETES ||
      (scanType == ScanType.USER_SCAN && tx.getVisibilityLevel() != Transaction.VisibilityLevel.SNAPSHOT_ALL);
  this.cellFilter = cellFilter;
}
 
Example 7
Source File: TransactionVisibilityFilter.java    From phoenix-tephra with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link org.apache.hadoop.hbase.filter.Filter} for returning data only from visible transactions.
 *
 * @param tx the current transaction to apply.  Only data visible to this transaction will be returned.
 * @param ttlByFamily map of time-to-live (TTL) (in milliseconds) by column family name
 * @param allowEmptyValues if {@code true} cells with empty {@code byte[]} values will be returned, if {@code false}
 *                         these will be interpreted as "delete" markers and the column will be filtered out
 * @param scanType the type of scan operation being performed
 * @param cellFilter if non-null, this filter will be applied to all cells visible to the current transaction, by
 *                   calling {@link Filter#filterKeyValue(org.apache.hadoop.hbase.Cell)}.  If null, then
 *                   {@link Filter.ReturnCode#INCLUDE_AND_NEXT_COL} will be returned instead.
 */
 public TransactionVisibilityFilter(Transaction tx, Map<byte[], Long> ttlByFamily, boolean allowEmptyValues,
                             ScanType scanType, @Nullable Filter cellFilter) {
  this.tx = tx;
  this.oldestTsByFamily = Maps.newTreeMap();
  for (Map.Entry<byte[], Long> ttlEntry : ttlByFamily.entrySet()) {
    long familyTTL = ttlEntry.getValue();
    oldestTsByFamily.put(new ImmutableBytesWritable(ttlEntry.getKey()),
                         familyTTL <= 0 ? 0 : tx.getVisibilityUpperBound() - familyTTL * TxConstants.MAX_TX_PER_MS);
  }
  this.allowEmptyValues = allowEmptyValues;
  this.clearDeletes =
    scanType == ScanType.COMPACT_DROP_DELETES ||
      (scanType == ScanType.USER_SCAN && tx.getVisibilityLevel() != Transaction.VisibilityLevel.SNAPSHOT_ALL);
  this.cellFilter = cellFilter;
}
 
Example 8
Source File: TransactionVisibilityFilter.java    From phoenix-tephra with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link org.apache.hadoop.hbase.filter.Filter} for returning data only from visible transactions.
 *
 * @param tx the current transaction to apply.  Only data visible to this transaction will be returned.
 * @param ttlByFamily map of time-to-live (TTL) (in milliseconds) by column family name
 * @param allowEmptyValues if {@code true} cells with empty {@code byte[]} values will be returned, if {@code false}
 *                         these will be interpreted as "delete" markers and the column will be filtered out
 * @param scanType the type of scan operation being performed
 * @param cellFilter if non-null, this filter will be applied to all cells visible to the current transaction, by
 *                   calling {@link Filter#filterKeyValue(org.apache.hadoop.hbase.Cell)}.  If null, then
 *                   {@link Filter.ReturnCode#INCLUDE_AND_NEXT_COL} will be returned instead.
 */
public TransactionVisibilityFilter(Transaction tx, Map<byte[], Long> ttlByFamily, boolean allowEmptyValues,
                            ScanType scanType, @Nullable Filter cellFilter) {
  this.tx = tx;
  this.oldestTsByFamily = Maps.newTreeMap(Bytes.BYTES_COMPARATOR);
  for (Map.Entry<byte[], Long> ttlEntry : ttlByFamily.entrySet()) {
    long familyTTL = ttlEntry.getValue();
    oldestTsByFamily.put(ttlEntry.getKey(),
                         familyTTL <= 0 ? 0 : tx.getVisibilityUpperBound() - familyTTL * TxConstants.MAX_TX_PER_MS);
  }
  this.allowEmptyValues = allowEmptyValues;
  this.clearDeletes =
    scanType == ScanType.COMPACT_DROP_DELETES ||
      (scanType == ScanType.USER_SCAN && tx.getVisibilityLevel() != Transaction.VisibilityLevel.SNAPSHOT_ALL);
  this.cellFilter = cellFilter;
}