Source:
<code>protected void uploadFiles(TopicPartition topicPartition) throws Exception { long committedOffsetCount = mOffsetTracker.getTrueCommittedOffsetCount(topicPartition); long lastSeenOffset = mOffsetTracker.getLastSeenOffset(topicPartition); String stripped = StringUtils.strip(mConfig.getZookeeperPath(), "/"); final String lockPath = Joiner.on("/").skipNulls().join( "", stripped.isEmpty() ? null : stripped, "secor", "locks", topicPartition.getTopic(), topicPartition.getPartition()); mZookeeperConnector.lock(lockPath); try { long zookeeperCommittedOffsetCount = mZookeeperConnector.getCommittedOffsetCount( topicPartition); if (zookeeperCommittedOffsetCount == committedOffsetCount) { LOG.info("uploading topic partition {}", topicPartition.getTopic(), topicPartition.getPartition()); mFileRegistry.deleteWriters(topicPartition); Collection<LogFilePath> paths = mFileRegistry.getPaths(topicPartition); List<Handle<?>> uploadHandles = new ArrayList<Handle<?>>(); for (LogFilePath path : paths) { uploadHandles.add(mUploadManager.upload(path)); } for (Handle<?> uploadHandle : uploadHandles) { uploadHandle.get(); } mFileRegistry.deleteTopicPartition(topicPartition); mZookeeperConnector.setCommittedOffsetCount(topicPartition, lastSeenOffset + 1); mOffsetTracker.setCommittedOffsetCount(topicPartition, lastSeenOffset + 1); <START> if (mConfig.getOffsetsStorage().equals("kafka")) { <END> mMessageReader.commit(); } mMetricCollector.increment("uploader.file_uploads.count", paths.size(), topicPartition.getTopic()); } } finally { mZookeeperConnector.unlock(lockPath); } }</code><technical_language>this constant "kafka" defined in a a central place, e.g. SecorConfig.java? 'equals' 'equalsIgnoreCase'</technical_language>

Target:
protected void uploadFiles(TopicPartition topicPartition) throws Exception { long committedOffsetCount = mOffsetTracker.getTrueCommittedOffsetCount(topicPartition); long lastSeenOffset = mOffsetTracker.getLastSeenOffset(topicPartition); String stripped = StringUtils.strip(mConfig.getZookeeperPath(), "/"); final String lockPath = Joiner.on("/").skipNulls().join( "", stripped.isEmpty() ? null : stripped, "secor", "locks", topicPartition.getTopic(), topicPartition.getPartition()); mZookeeperConnector.lock(lockPath); try { long zookeeperCommittedOffsetCount = mZookeeperConnector.getCommittedOffsetCount( topicPartition); if (zookeeperCommittedOffsetCount == committedOffsetCount) { LOG.info("uploading topic partition {}", topicPartition.getTopic(), topicPartition.getPartition()); mFileRegistry.deleteWriters(topicPartition); Collection<LogFilePath> paths = mFileRegistry.getPaths(topicPartition); List<Handle<?>> uploadHandles = new ArrayList<Handle<?>>(); for (LogFilePath path : paths) { uploadHandles.add(mUploadManager.upload(path)); } for (Handle<?> uploadHandle : uploadHandles) { uploadHandle.get(); } mFileRegistry.deleteTopicPartition(topicPartition); mZookeeperConnector.setCommittedOffsetCount(topicPartition, lastSeenOffset + 1); mOffsetTracker.setCommittedOffsetCount(topicPartition, lastSeenOffset + 1); if (isOffsetsStorageKafka) { mMessageReader.commit(); } mMetricCollector.increment("uploader.file_uploads.count", paths.size(), topicPartition.getTopic()); } } finally { mZookeeperConnector.unlock(lockPath); } }