@Test public void persistAndHydrateMin() { assertThat(TargetedSweepMetadata.BYTES_HYDRATOR.hydrateFromBytes(ALL_ZERO_METADATA.persistToBytes())) .isEqualTo(ALL_ZERO_METADATA); }
@Override public byte[] persistToBytes() { byte[] result = new byte[] { 0, 0, 0, 0 }; result[0] |= (shard() & BYTE_MASK) >> 2; if (dedicatedRow()) { result[0] |= USE_DEDICATED_ROWS_MASK; } if (conservative()) { result[0] |= SWEEP_STRATEGY_MASK; } result[1] |= dedicatedRowNumber() & DEDICATED_ROW_NUMBER_MASK; result[1] |= (shard() << 6) & BYTE_MASK; return result; }
TargetedSweepMetadata implements Persistable { @Override public byte[] persistToBytes() { byte[] result = new byte[] { 0, 0, 0, 0 }; result[0] |= (shard() & BYTE_MASK) >> 2; if (dedicatedRow()) { result[0] |= USE_DEDICATED_ROWS_MASK; } if (conservative()) { result[0] |= SWEEP_STRATEGY_MASK; } result[1] |= dedicatedRowNumber() & DEDICATED_ROW_NUMBER_MASK; result[1] |= (shard() << 6) & BYTE_MASK; return result; } }
TargetedSweepMetadata implements Persistable { @Override public byte[] persistToBytes() { byte[] result = new byte[] { 0, 0, 0, 0 }; result[0] |= (shard() & BYTE_MASK) >> 2; if (dedicatedRow()) { result[0] |= USE_DEDICATED_ROWS_MASK; } if (conservative()) { result[0] |= SWEEP_STRATEGY_MASK; } result[1] |= dedicatedRowNumber() & DEDICATED_ROW_NUMBER_MASK; result[1] |= (shard() << 6) & BYTE_MASK; return result; }  }
TargetedSweepMetadata implements Persistable { @Override public byte[] persistToBytes() { byte[] result = new byte[] { 0, 0, 0, 0 }; result[0] |= (shard() & BYTE_MASK) >> 2; if (dedicatedRow()) { result[0] |= USE_DEDICATED_ROWS_MASK; } if (conservative()) { result[0] |= SWEEP_STRATEGY_MASK; } result[1] |= dedicatedRowNumber() & DEDICATED_ROW_NUMBER_MASK; result[1] |= (shard() << 6) & BYTE_MASK; return result; }  abstract boolean conservative(); abstract boolean dedicatedRow(); abstract int shard(); abstract long dedicatedRowNumber(); @Override byte[] persistToBytes(); }
TargetedSweepMetadata implements Persistable { @Override public byte[] persistToBytes() { byte[] result = new byte[] { 0, 0, 0, 0 }; result[0] |= (shard() & BYTE_MASK) >> 2; if (dedicatedRow()) { result[0] |= USE_DEDICATED_ROWS_MASK; } if (conservative()) { result[0] |= SWEEP_STRATEGY_MASK; } result[1] |= dedicatedRowNumber() & DEDICATED_ROW_NUMBER_MASK; result[1] |= (shard() << 6) & BYTE_MASK; return result; }  abstract boolean conservative(); abstract boolean dedicatedRow(); abstract int shard(); abstract long dedicatedRowNumber(); @Override byte[] persistToBytes(); static final int MAX_SHARDS; static final int MAX_DEDICATED_ROWS; static final Hydrator<TargetedSweepMetadata> BYTES_HYDRATOR; }