public Set<CoordinatorStreamMessage> getBootstrappedStream(String type) { log.debug("Bootstrapping coordinator stream for messages of type {}", type); bootstrap(); LinkedHashSet<CoordinatorStreamMessage> bootstrappedStream = new LinkedHashSet<CoordinatorStreamMessage>(); for (CoordinatorStreamMessage coordinatorStreamMessage : bootstrappedStreamSet) { log.trace("Considering message: {}", coordinatorStreamMessage); if (type.equalsIgnoreCase(coordinatorStreamMessage.getType())) { log.trace("Adding message: {}", coordinatorStreamMessage); bootstrappedStream.add(coordinatorStreamMessage); } } return bootstrappedStream; }
public Set<CoordinatorStreamMessage> getBootstrappedStream(String type) { log.debug("Bootstrapping coordinator stream for messages of type {}", type); bootstrap(); LinkedHashSet<CoordinatorStreamMessage> bootstrappedStream = new LinkedHashSet<CoordinatorStreamMessage>(); for (CoordinatorStreamMessage coordinatorStreamMessage : bootstrappedStreamSet) { log.trace("Considering message: {}", coordinatorStreamMessage); if (type.equalsIgnoreCase(coordinatorStreamMessage.getType())) { log.trace("Adding message: {}", coordinatorStreamMessage); bootstrappedStream.add(coordinatorStreamMessage); } } return bootstrappedStream; }
public Set<CoordinatorStreamMessage> getBootstrappedStream(String type) { log.debug("Bootstrapping coordinator stream for messages of type {}", type); bootstrap(); LinkedHashSet<CoordinatorStreamMessage> bootstrappedStream = new LinkedHashSet<CoordinatorStreamMessage>(); for (CoordinatorStreamMessage coordinatorStreamMessage : bootstrappedStreamSet) { log.trace("Considering message: {}", coordinatorStreamMessage); if (type.equalsIgnoreCase(coordinatorStreamMessage.getType())) { log.trace("Adding message: {}", coordinatorStreamMessage); bootstrappedStream.add(coordinatorStreamMessage); } } return bootstrappedStream; }
public Set<CoordinatorStreamMessage> getBootstrappedStream(String type) { log.debug("Bootstrapping coordinator stream for messages of type {}", type); bootstrap(); LinkedHashSet<CoordinatorStreamMessage> bootstrappedStream = new LinkedHashSet<CoordinatorStreamMessage>(); for (CoordinatorStreamMessage coordinatorStreamMessage : bootstrappedStreamSet) { log.trace("Considering message: {}", coordinatorStreamMessage); if (type.equalsIgnoreCase(coordinatorStreamMessage.getType())) { log.trace("Adding message: {}", coordinatorStreamMessage); bootstrappedStream.add(coordinatorStreamMessage); } } return bootstrappedStream; }
public Set<CoordinatorStreamMessage> getBootstrappedStream(String type) { log.debug("Bootstrapping coordinator stream for messages of type {}", type); bootstrap(); LinkedHashSet<CoordinatorStreamMessage> bootstrappedStream = new LinkedHashSet<CoordinatorStreamMessage>(); for (CoordinatorStreamMessage coordinatorStreamMessage : bootstrappedStreamSet) { log.trace("Considering message: {}", coordinatorStreamMessage); if (type.equalsIgnoreCase(coordinatorStreamMessage.getType())) { log.trace("Adding message: {}", coordinatorStreamMessage); bootstrappedStream.add(coordinatorStreamMessage); } } return bootstrappedStream; }
/** * Returns all the messages from the earliest offset all the way to the latest. */ private void bootstrapMessagesFromStream() { synchronized (bootstrapLock) { while (iterator.hasNext()) { IncomingMessageEnvelope envelope = iterator.next(); byte[] keyAsBytes = (byte[]) envelope.getKey(); Object[] keyArray = keySerde.fromBytes(keyAsBytes).toArray(); CoordinatorStreamMessage coordinatorStreamMessage = new CoordinatorStreamMessage(keyArray, new HashMap<>()); if (Objects.equals(coordinatorStreamMessage.getType(), type)) { if (envelope.getMessage() != null) { bootstrappedMessages.put(keyAsBytes, (byte[]) envelope.getMessage()); } else { bootstrappedMessages.remove(keyAsBytes); } } } } }
/** * Returns all the messages from the earliest offset all the way to the latest. */ private void bootstrapMessagesFromStream() { synchronized (bootstrapLock) { while (iterator.hasNext()) { IncomingMessageEnvelope envelope = iterator.next(); byte[] keyAsBytes = (byte[]) envelope.getKey(); Object[] keyArray = keySerde.fromBytes(keyAsBytes).toArray(); CoordinatorStreamMessage coordinatorStreamMessage = new CoordinatorStreamMessage(keyArray, new HashMap<>()); if (Objects.equals(coordinatorStreamMessage.getType(), type)) { if (envelope.getMessage() != null) { bootstrappedMessages.put(keyAsBytes, (byte[]) envelope.getMessage()); } else { bootstrappedMessages.remove(keyAsBytes); } } } } }
/** * Returns all the messages from the earliest offset all the way to the latest. */ private void bootstrapMessagesFromStream() { synchronized (bootstrapLock) { while (iterator.hasNext()) { IncomingMessageEnvelope envelope = iterator.next(); byte[] keyAsBytes = (byte[]) envelope.getKey(); Object[] keyArray = keySerde.fromBytes(keyAsBytes).toArray(); CoordinatorStreamMessage coordinatorStreamMessage = new CoordinatorStreamMessage(keyArray, new HashMap<>()); if (Objects.equals(coordinatorStreamMessage.getType(), type)) { if (envelope.getMessage() != null) { bootstrappedMessages.put(keyAsBytes, (byte[]) envelope.getMessage()); } else { bootstrappedMessages.remove(keyAsBytes); } } } } }
/** * Returns all the messages from the earliest offset all the way to the latest. */ private void bootstrapMessagesFromStream() { synchronized (bootstrapLock) { while (iterator.hasNext()) { IncomingMessageEnvelope envelope = iterator.next(); byte[] keyAsBytes = (byte[]) envelope.getKey(); Object[] keyArray = keySerde.fromBytes(keyAsBytes).toArray(); CoordinatorStreamMessage coordinatorStreamMessage = new CoordinatorStreamMessage(keyArray, new HashMap<>()); if (Objects.equals(coordinatorStreamMessage.getType(), type)) { if (envelope.getMessage() != null) { bootstrappedMessages.put(keyAsBytes, (byte[]) envelope.getMessage()); } else { bootstrappedMessages.remove(keyAsBytes); } } } } }
/** * Returns all the messages from the earliest offset all the way to the latest. */ private void bootstrapMessagesFromStream() { synchronized (bootstrapLock) { while (iterator.hasNext()) { IncomingMessageEnvelope envelope = iterator.next(); byte[] keyAsBytes = (byte[]) envelope.getKey(); Serde<List<?>> serde = new JsonSerde<>(); Object[] keyArray = serde.fromBytes(keyAsBytes).toArray(); CoordinatorStreamMessage coordinatorStreamMessage = new CoordinatorStreamMessage(keyArray, new HashMap<>()); if (Objects.equals(coordinatorStreamMessage.getType(), type)) { if (envelope.getMessage() != null) { bootstrappedMessages.put(coordinatorStreamMessage.getKey(), (byte[]) envelope.getMessage()); } else { bootstrappedMessages.remove(coordinatorStreamMessage.getKey()); } } } } }
/** * returns all unread messages of a specific type, after an iterator on the stream * * @param iterator the iterator pointing to an offset in the coordinator stream. All unread messages after this iterator are returned * @param type the type of the messages to be returned * @return a set of unread messages of a given type, after a given iterator */ public Set<CoordinatorStreamMessage> getUnreadMessages(SystemStreamPartitionIterator iterator, String type) { LinkedHashSet<CoordinatorStreamMessage> messages = new LinkedHashSet<CoordinatorStreamMessage>(); while (iterator.hasNext()) { IncomingMessageEnvelope envelope = iterator.next(); Object[] keyArray = keySerde.fromBytes((byte[]) envelope.getKey()).toArray(); Map<String, Object> valueMap = null; if (envelope.getMessage() != null) { valueMap = messageSerde.fromBytes((byte[]) envelope.getMessage()); } CoordinatorStreamMessage coordinatorStreamMessage = new CoordinatorStreamMessage(keyArray, valueMap); if (type == null || type.equals(coordinatorStreamMessage.getType())) { messages.add(coordinatorStreamMessage); } } return messages; }
/** * returns all unread messages of a specific type, after an iterator on the stream * * @param iterator the iterator pointing to an offset in the coordinator stream. All unread messages after this iterator are returned * @param type the type of the messages to be returned * @return a set of unread messages of a given type, after a given iterator */ public Set<CoordinatorStreamMessage> getUnreadMessages(SystemStreamPartitionIterator iterator, String type) { LinkedHashSet<CoordinatorStreamMessage> messages = new LinkedHashSet<CoordinatorStreamMessage>(); while (iterator.hasNext()) { IncomingMessageEnvelope envelope = iterator.next(); Object[] keyArray = keySerde.fromBytes((byte[]) envelope.getKey()).toArray(); Map<String, Object> valueMap = null; if (envelope.getMessage() != null) { valueMap = messageSerde.fromBytes((byte[]) envelope.getMessage()); } CoordinatorStreamMessage coordinatorStreamMessage = new CoordinatorStreamMessage(keyArray, valueMap); if (type == null || type.equals(coordinatorStreamMessage.getType())) { messages.add(coordinatorStreamMessage); } } return messages; }
/** * returns all unread messages of a specific type, after an iterator on the stream * * @param iterator the iterator pointing to an offset in the coordinator stream. All unread messages after this iterator are returned * @param type the type of the messages to be returned * @return a set of unread messages of a given type, after a given iterator */ public Set<CoordinatorStreamMessage> getUnreadMessages(SystemStreamPartitionIterator iterator, String type) { LinkedHashSet<CoordinatorStreamMessage> messages = new LinkedHashSet<CoordinatorStreamMessage>(); while (iterator.hasNext()) { IncomingMessageEnvelope envelope = iterator.next(); Object[] keyArray = keySerde.fromBytes((byte[]) envelope.getKey()).toArray(); Map<String, Object> valueMap = null; if (envelope.getMessage() != null) { valueMap = messageSerde.fromBytes((byte[]) envelope.getMessage()); } CoordinatorStreamMessage coordinatorStreamMessage = new CoordinatorStreamMessage(keyArray, valueMap); if (type == null || type.equals(coordinatorStreamMessage.getType())) { messages.add(coordinatorStreamMessage); } } return messages; }
/** * returns all unread messages of a specific type, after an iterator on the stream * * @param iterator the iterator pointing to an offset in the coordinator stream. All unread messages after this iterator are returned * @param type the type of the messages to be returned * @return a set of unread messages of a given type, after a given iterator */ public Set<CoordinatorStreamMessage> getUnreadMessages(SystemStreamPartitionIterator iterator, String type) { LinkedHashSet<CoordinatorStreamMessage> messages = new LinkedHashSet<CoordinatorStreamMessage>(); while (iterator.hasNext()) { IncomingMessageEnvelope envelope = iterator.next(); Object[] keyArray = keySerde.fromBytes((byte[]) envelope.getKey()).toArray(); Map<String, Object> valueMap = null; if (envelope.getMessage() != null) { valueMap = messageSerde.fromBytes((byte[]) envelope.getMessage()); } CoordinatorStreamMessage coordinatorStreamMessage = new CoordinatorStreamMessage(keyArray, valueMap); if (type == null || type.equals(coordinatorStreamMessage.getType())) { messages.add(coordinatorStreamMessage); } } return messages; }
/** * returns all unread messages of a specific type, after an iterator on the stream * * @param iterator the iterator pointing to an offset in the coordinator stream. All unread messages after this iterator are returned * @param type the type of the messages to be returned * @return a set of unread messages of a given type, after a given iterator */ public Set<CoordinatorStreamMessage> getUnreadMessages(SystemStreamPartitionIterator iterator, String type) { LinkedHashSet<CoordinatorStreamMessage> messages = new LinkedHashSet<CoordinatorStreamMessage>(); while (iterator.hasNext()) { IncomingMessageEnvelope envelope = iterator.next(); Object[] keyArray = keySerde.fromBytes((byte[]) envelope.getKey()).toArray(); Map<String, Object> valueMap = null; if (envelope.getMessage() != null) { valueMap = messageSerde.fromBytes((byte[]) envelope.getMessage()); } CoordinatorStreamMessage coordinatorStreamMessage = new CoordinatorStreamMessage(keyArray, valueMap); if (type == null || type.equals(coordinatorStreamMessage.getType())) { messages.add(coordinatorStreamMessage); } } return messages; }
if (SetConfig.TYPE.equals(coordinatorStreamMessage.getType())) { String configKey = coordinatorStreamMessage.getKey(); if (coordinatorStreamMessage.isDelete()) {
if (SetConfig.TYPE.equals(coordinatorStreamMessage.getType())) { String configKey = coordinatorStreamMessage.getKey(); if (coordinatorStreamMessage.isDelete()) {
if (SetConfig.TYPE.equals(coordinatorStreamMessage.getType())) { String configKey = coordinatorStreamMessage.getKey(); if (coordinatorStreamMessage.isDelete()) {
if (SetConfig.TYPE.equals(coordinatorStreamMessage.getType())) { String configKey = coordinatorStreamMessage.getKey(); if (coordinatorStreamMessage.isDelete()) {
if (SetConfig.TYPE.equals(coordinatorStreamMessage.getType())) { String configKey = coordinatorStreamMessage.getKey(); if (coordinatorStreamMessage.isDelete()) {