/** * Computes a partition key based on the given {@link LoggingContext}. */ public String getPartitionKey(LoggingContext loggingContext) { String namespaceId = loggingContext.getSystemTagsMap().get(NamespaceLoggingContext.TAG_NAMESPACE_ID).getValue(); if (NamespaceId.SYSTEM.getNamespace().equals(namespaceId)) { return loggingContext.getLogPartition(); } switch (this) { case PROGRAM: return loggingContext.getLogPartition(); case APPLICATION: return namespaceId + ":" + loggingContext.getSystemTagsMap().get(ApplicationLoggingContext.TAG_APPLICATION_ID).getValue(); default: // this should never happen throw new IllegalArgumentException( String.format("Invalid log partition type %s. Allowed partition types are program/application", getClass())); } } }
private long getCheckpointTime(LoggingContext loggingContext) { int partition = partitioner.partition(loggingContext.getLogPartition(), -1); try { return checkpointManager.getCheckpoint(partition).getMaxEventTime(); } catch (Exception e) { LOG.error("Got exception while reading checkpoint", e); } return -1; } }
private long getCheckpointTime(LoggingContext loggingContext) { int partition = partitioner.partition(loggingContext.getLogPartition(), -1); try { return checkpointManager.getCheckpoint(partition).getMaxEventTime(); } catch (Exception e) { LOG.error("Got exception while reading checkpoint", e); } return -1; } }
/** * Computes a partition key based on the given {@link LoggingContext}. */ public String getPartitionKey(LoggingContext loggingContext) { String namespaceId = loggingContext.getSystemTagsMap().get(NamespaceLoggingContext.TAG_NAMESPACE_ID).getValue(); if (NamespaceId.SYSTEM.getNamespace().equals(namespaceId)) { return loggingContext.getLogPartition(); } switch (this) { case PROGRAM: return loggingContext.getLogPartition(); case APPLICATION: return namespaceId + ":" + loggingContext.getSystemTagsMap().get(ApplicationLoggingContext.TAG_APPLICATION_ID).getValue(); default: // this should never happen throw new IllegalArgumentException( String.format("Invalid log partition type %s. Allowed partition types are program/application", getClass())); } } }
int partition = partitioner.partition(loggingContext.getLogPartition(), -1); LOG.trace("Reading from kafka {}:{}", topic, partition);
int partition = partitioner.partition(loggingContext.getLogPartition(), -1); LOG.trace("Reading from kafka {}:{}", topic, partition);
int partition = partitioner.partition(loggingContext.getLogPartition(), -1); LOG.trace("Reading from kafka partition {}", partition);
int partition = partitioner.partition(loggingContext.getLogPartition(), -1); LOG.trace("Reading from kafka partition {}", partition);