@Override public ReturnCode filterKeyValue(Cell cell) throws IOException { int rowKeyOffset = cell.getRowOffset() + prefixLength; int sizeOfRowKey = cell.getRowLength() - prefixLength; long publishTimestamp = MessagingUtils.getPublishTimestamp(cell.getRowArray(), rowKeyOffset, sizeOfRowKey); int topicIdLength = MessagingUtils.getTopicLengthMessageEntry(sizeOfRowKey) - Bytes.SIZEOF_INT; int generationId = Bytes.toInt(cell.getRowArray(), rowKeyOffset + topicIdLength); if (prevTopicIdBytes == null || currentTTL == null || currentGen == null || (!Bytes.equals(prevTopicIdBytes, 0, prevTopicIdBytes.length, cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegion().getRegionNameAsString() + ", could not get properties of topicId " + MessagingUtils.toTopicId(prevTopicIdBytes)); return ReturnCode.INCLUDE; } currentTTL = Long.parseLong(properties.get(MessagingUtils.Constants.TTL_KEY)); currentGen = Integer.parseInt(properties.get(MessagingUtils.Constants.GENERATION_KEY)); } // Old Generation (or deleted current generation) cleanup if (MessagingUtils.isOlderGeneration(generationId, currentGen)) { return ReturnCode.SKIP; } // TTL expiration cleanup only if the generation of metadata and row key are the same if ((generationId == currentGen) && ((timestamp - publishTimestamp) > currentTTL)) { return ReturnCode.SKIP; } return ReturnCode.INCLUDE; }
cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegionInfo().getRegionNameAsString() + ", could not get properties of topicId "
cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegion().getRegionNameAsString() + ", could not get properties of topicId "
cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegionInfo().getRegionNameAsString() + ", could not get properties of topicId "
@Override public ReturnCode filterKeyValue(Cell cell) throws IOException { int rowKeyOffset = cell.getRowOffset() + prefixLength; int sizeOfRowKey = cell.getRowLength() - prefixLength; long publishTimestamp = MessagingUtils.getPublishTimestamp(cell.getRowArray(), rowKeyOffset, sizeOfRowKey); int topicIdLength = MessagingUtils.getTopicLengthMessageEntry(sizeOfRowKey) - Bytes.SIZEOF_INT; int generationId = Bytes.toInt(cell.getRowArray(), rowKeyOffset + topicIdLength); if (prevTopicIdBytes == null || currentTTL == null || currentGen == null || (!Bytes.equals(prevTopicIdBytes, 0, prevTopicIdBytes.length, cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegionInfo().getRegionNameAsString() + ", could not get properties of topicId " + MessagingUtils.toTopicId(prevTopicIdBytes)); return ReturnCode.INCLUDE; } currentTTL = Long.parseLong(properties.get(MessagingUtils.Constants.TTL_KEY)); currentGen = Integer.parseInt(properties.get(MessagingUtils.Constants.GENERATION_KEY)); } // Old Generation (or deleted current generation) cleanup if (MessagingUtils.isOlderGeneration(generationId, currentGen)) { return ReturnCode.SKIP; } // TTL expiration cleanup only if the generation of metadata and row key are the same if ((generationId == currentGen) && ((timestamp - publishTimestamp) > currentTTL)) { return ReturnCode.SKIP; } return ReturnCode.INCLUDE; }
@Override public ReturnCode filterKeyValue(Cell cell) throws IOException { int rowKeyOffset = cell.getRowOffset() + prefixLength; int sizeOfRowKey = cell.getRowLength() - prefixLength; long publishTimestamp = MessagingUtils.getPublishTimestamp(cell.getRowArray(), rowKeyOffset, sizeOfRowKey); int topicIdLength = MessagingUtils.getTopicLengthMessageEntry(sizeOfRowKey) - Bytes.SIZEOF_INT; int generationId = Bytes.toInt(cell.getRowArray(), rowKeyOffset + topicIdLength); if (prevTopicIdBytes == null || currentTTL == null || currentGen == null || (!Bytes.equals(prevTopicIdBytes, 0, prevTopicIdBytes.length, cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegion().getRegionNameAsString() + ", could not get properties of topicId " + MessagingUtils.toTopicId(prevTopicIdBytes)); return ReturnCode.INCLUDE; } currentTTL = Long.parseLong(properties.get(MessagingUtils.Constants.TTL_KEY)); currentGen = Integer.parseInt(properties.get(MessagingUtils.Constants.GENERATION_KEY)); } // Old Generation (or deleted current generation) cleanup if (MessagingUtils.isOlderGeneration(generationId, currentGen)) { return ReturnCode.SKIP; } // TTL expiration cleanup only if the generation of metadata and row key are the same if ((generationId == currentGen) && ((timestamp - publishTimestamp) > currentTTL)) { return ReturnCode.SKIP; } return ReturnCode.INCLUDE; }
@Override public ReturnCode filterKeyValue(Cell cell) throws IOException { int rowKeyOffset = cell.getRowOffset() + prefixLength; int sizeOfRowKey = cell.getRowLength() - prefixLength; long publishTimestamp = MessagingUtils.getPublishTimestamp(cell.getRowArray(), rowKeyOffset, sizeOfRowKey); int topicIdLength = MessagingUtils.getTopicLengthMessageEntry(sizeOfRowKey) - Bytes.SIZEOF_INT; int generationId = Bytes.toInt(cell.getRowArray(), rowKeyOffset + topicIdLength); if (prevTopicIdBytes == null || currentTTL == null || currentGen == null || (!Bytes.equals(prevTopicIdBytes, 0, prevTopicIdBytes.length, cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegionInfo().getRegionNameAsString() + ", could not get properties of topicId " + MessagingUtils.toTopicId(prevTopicIdBytes)); return ReturnCode.INCLUDE; } currentTTL = Long.parseLong(properties.get(MessagingUtils.Constants.TTL_KEY)); currentGen = Integer.parseInt(properties.get(MessagingUtils.Constants.GENERATION_KEY)); } // Old Generation (or deleted current generation) cleanup if (MessagingUtils.isOlderGeneration(generationId, currentGen)) { return ReturnCode.SKIP; } // TTL expiration cleanup only if the generation of metadata and row key are the same if ((generationId == currentGen) && ((timestamp - publishTimestamp) > currentTTL)) { return ReturnCode.SKIP; } return ReturnCode.INCLUDE; }
@Override public ReturnCode filterKeyValue(Cell cell) throws IOException { int rowKeyOffset = cell.getRowOffset() + prefixLength; int sizeOfRowKey = cell.getRowLength() - prefixLength; long publishTimestamp = MessagingUtils.getPublishTimestamp(cell.getRowArray(), rowKeyOffset, sizeOfRowKey); int topicIdLength = MessagingUtils.getTopicLengthMessageEntry(sizeOfRowKey) - Bytes.SIZEOF_INT; int generationId = Bytes.toInt(cell.getRowArray(), rowKeyOffset + topicIdLength); if (prevTopicIdBytes == null || currentTTL == null || currentGen == null || (!Bytes.equals(prevTopicIdBytes, 0, prevTopicIdBytes.length, cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegionInfo().getRegionNameAsString() + ", could not get properties of topicId " + MessagingUtils.toTopicId(prevTopicIdBytes)); return ReturnCode.INCLUDE; } currentTTL = Long.parseLong(properties.get(MessagingUtils.Constants.TTL_KEY)); currentGen = Integer.parseInt(properties.get(MessagingUtils.Constants.GENERATION_KEY)); } // Old Generation (or deleted current generation) cleanup if (MessagingUtils.isOlderGeneration(generationId, currentGen)) { return ReturnCode.SKIP; } // TTL expiration cleanup only if the generation of metadata and row key are the same if ((generationId == currentGen) && ((timestamp - publishTimestamp) > currentTTL)) { return ReturnCode.SKIP; } return ReturnCode.INCLUDE; }
@Override public ReturnCode filterKeyValue(Cell cell) throws IOException { int rowKeyOffset = cell.getRowOffset() + prefixLength; int sizeOfRowKey = cell.getRowLength() - prefixLength; long publishTimestamp = MessagingUtils.getPublishTimestamp(cell.getRowArray(), rowKeyOffset, sizeOfRowKey); int topicIdLength = MessagingUtils.getTopicLengthMessageEntry(sizeOfRowKey) - Bytes.SIZEOF_INT; int generationId = Bytes.toInt(cell.getRowArray(), rowKeyOffset + topicIdLength); if (prevTopicIdBytes == null || currentTTL == null || currentGen == null || (!Bytes.equals(prevTopicIdBytes, 0, prevTopicIdBytes.length, cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegion().getRegionNameAsString() + ", could not get properties of topicId " + MessagingUtils.toTopicId(prevTopicIdBytes)); return ReturnCode.INCLUDE; } currentTTL = Long.parseLong(properties.get(MessagingUtils.Constants.TTL_KEY)); currentGen = Integer.parseInt(properties.get(MessagingUtils.Constants.GENERATION_KEY)); } // Old Generation (or deleted current generation) cleanup if (MessagingUtils.isOlderGeneration(generationId, currentGen)) { return ReturnCode.SKIP; } // TTL expiration cleanup only if the generation of metadata and row key are the same if ((generationId == currentGen) && ((timestamp - publishTimestamp) > currentTTL)) { return ReturnCode.SKIP; } return ReturnCode.INCLUDE; }
@Override public ReturnCode filterKeyValue(Cell cell) throws IOException { int rowKeyOffset = cell.getRowOffset() + prefixLength; int sizeOfRowKey = cell.getRowLength() - prefixLength; long publishTimestamp = MessagingUtils.getPublishTimestamp(cell.getRowArray(), rowKeyOffset, sizeOfRowKey); int topicIdLength = MessagingUtils.getTopicLengthMessageEntry(sizeOfRowKey) - Bytes.SIZEOF_INT; int generationId = Bytes.toInt(cell.getRowArray(), rowKeyOffset + topicIdLength); if (prevTopicIdBytes == null || currentTTL == null || currentGen == null || (!Bytes.equals(prevTopicIdBytes, 0, prevTopicIdBytes.length, cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegion().getRegionNameAsString() + ", could not get properties of topicId " + MessagingUtils.toTopicId(prevTopicIdBytes)); return ReturnCode.INCLUDE; } currentTTL = Long.parseLong(properties.get(MessagingUtils.Constants.TTL_KEY)); currentGen = Integer.parseInt(properties.get(MessagingUtils.Constants.GENERATION_KEY)); } // Old Generation (or deleted current generation) cleanup if (MessagingUtils.isOlderGeneration(generationId, currentGen)) { return ReturnCode.SKIP; } // TTL expiration cleanup only if the generation of metadata and row key are the same if ((generationId == currentGen) && ((timestamp - publishTimestamp) > currentTTL)) { return ReturnCode.SKIP; } return ReturnCode.INCLUDE; }
cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegionInfo().getRegionNameAsString() + ", could not get properties of topicId "
cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegionInfo().getRegionNameAsString() + ", could not get properties of topicId "
cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegion().getRegionNameAsString() + ", could not get properties of topicId "
cell.getRowArray(), rowKeyOffset, topicIdLength))) { prevTopicIdBytes = Arrays.copyOfRange(cell.getRowArray(), rowKeyOffset, rowKeyOffset + topicIdLength); Map<String, String> properties = metadataCache.getTopicMetadata(ByteBuffer.wrap(prevTopicIdBytes)); if (properties == null) { LOG.debug("Region " + env.getRegionInfo().getRegionNameAsString() + ", could not get properties of topicId "