auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void removeAllPrivateWorkerKeys(String topologyId) { for (WorkerTokenServiceType type : WorkerTokenServiceType.values()) { String path = ClusterUtils.secretKeysPath(type, topologyId); try { LOG.debug("Removing worker keys under {}", path); stateStorage.delete_node(path); } catch (RuntimeException e) { //This should never happen because only the primary nimbus is active, but just in case // declare the race safe, even if we lose it. if (!Utils.exceptionCauseIsInstanceOf(KeeperException.NoNodeException.class, e)) { throw e; } } } }

Target:
public void removeAllPrivateWorkerKeys(String topologyId) { for (WorkerTokenServiceType type : WorkerTokenServiceType.values()) { String path = ClusterUtils.secretKeysPath(type, topologyId); try { LOG.info("Removing worker keys under {}", path); stateStorage.delete_node(path); } catch (RuntimeException e) { //This should never happen because only the primary nimbus is active, but just in case // declare the race safe, even if we lose it. if (!Utils.exceptionCauseIsInstanceOf(KeeperException.NoNodeException.class, e)) { throw e; } } } }
Source:
public Values(Object... vals) { super(vals != null ? vals.length : 0); if (vals != null ) { for (Object o : vals) { add(o); } } else { add(null); } }

Target:
public Values(Object... vals) { super(vals != null ? vals.length : 1); if (vals != null ) { for (Object o : vals) { add(o); } } else { add(null); } }
Source:
private void closeFlushScheduler() { if (flushScheduler != null) { flushScheduler.shutdown(); try { if (!flushScheduler.awaitTermination(1, TimeUnit.SECONDS)) { flushScheduler.shutdownNow(); if (!flushScheduler.awaitTermination(1, TimeUnit.SECONDS)) { LOG.error("Flush scheduler did not terminate after trials of shutdown."); } } } catch (InterruptedException ie) { // (Re-)Cancel if current thread also interrupted flushScheduler.shutdownNow(); // Preserve interrupt status Thread.currentThread().interrupt(); } } }

Target:
private void closeFlushScheduler() { if (flushScheduler != null) { flushScheduler.shutdown(); try { if (!flushScheduler.awaitTermination(2, TimeUnit.SECONDS)) { flushScheduler.shutdownNow(); } } catch (InterruptedException ie) { // (Re-)Cancel if current thread also interrupted flushScheduler.shutdownNow(); // Preserve interrupt status Thread.currentThread().interrupt(); } } }
Source:
public void addToEmitMsgs(long offset) { this.emittedOffsets.add(offset); // O(Log N) this.latestEmittedOffset = offset; }

Target:
public void addToEmitMsgs(long offset) { this.emittedOffsets.add(offset); // O(Log N) this.latestEmittedOffset = Math.max(latestEmittedOffset, offset); }
Source:
protected void process(Tuple tuple) { try { LOG.debug("Processing Tuple: {}", tuple); SolrRequest request = solrMapper.toSolrRequest(tuple); solrClient.request(request, solrMapper.getCollection()); ack(tuple); LOG.debug("Acked Tuple: {}", tuple); } catch (Exception e) { fail(tuple, e); } }

Target:
protected void process(Tuple tuple) { try { SolrRequest request = solrMapper.toSolrRequest(tuple); solrClient.request(request, solrMapper.getCollection()); ack(tuple); } catch (Exception e) { fail(tuple, e); } }
Source:
public void disconnect() { stateStorage.unregister(stateId); if (solo) { stateStorage.close(); this.assignmentsBackend.dispose(); } }

Target:
public void disconnect() { stateStorage.unregister(stateId); if (solo) { stateStorage.close(); this.assignmentsBackend.close(); } }
Source:
private static String checkInitResource(Map<String, Double> topologyResources, Map topologyConf, String resourceName) { StringBuilder msgBuilder = new StringBuilder(); if (topologyResources.containsKey(resourceName)) { Double resourceValue = (Double) topologyConf.getOrDefault(resourceName, null); topologyResources.put(resourceName, resourceValue); msgBuilder.append(resourceName.substring(resourceName.lastIndexOf(".")) + " has been set to " + resourceValue); } return msgBuilder.toString(); }

Target:
private static String checkInitResource(Map<String, Double> topologyResources, Map topologyConf, String resourceName) { StringBuilder msgBuilder = new StringBuilder(); if (topologyResources.containsKey(resourceName)) { Double resourceValue = (Double) topologyConf.getOrDefault(resourceName, null); if (resourceValue != null) { topologyResources.put(resourceName, resourceValue); msgBuilder.append(resourceName.substring(resourceName.lastIndexOf(".")) + " has been set to " + resourceValue); } } return msgBuilder.toString(); }
Source:
public void tearDown() { if (waterMarkEventGenerator != null) { waterMarkEventGenerator.shutdown(); } }

Target:
public void tearDown() { waterMarkEventGenerator.shutdown(); }
Source:
public void shutdown() { LOG.debug("Shutting down WaterMarkEventGenerator"); if (this.executorService != null) { executorService.shutdown(); try { if (!executorService.awaitTermination(2, TimeUnit.SECONDS)) { executorService.shutdownNow(); } } catch (InterruptedException ie) { executorService.shutdownNow(); Thread.currentThread().interrupt(); } } }

Target:
public void shutdown() { LOG.debug("Shutting down WaterMarkEventGenerator"); executorService.shutdown(); try { if (!executorService.awaitTermination(2, TimeUnit.SECONDS)) { executorService.shutdownNow(); } } catch (InterruptedException ie) { executorService.shutdownNow(); Thread.currentThread().interrupt(); } }
Source:
public JedisClusterConfig(Set<InetSocketAddress> nodes, int timeout, int maxRedirections) { Preconditions.checkNotNull(nodes, "Node information should be presented"); this.nodes = nodes; this.timeout = timeout; this.maxRedirections = maxRedirections; }

Target:
public JedisClusterConfig(Set<InetSocketAddress> nodes, int timeout, int maxRedirections) { this(nodes, timeout, maxRedirections, null); }
Source:
public LinearDRPCInputDeclarer addSharedMemory(SharedMemory request) { _component.sharedMemory.add(request); return null; }

Target:
public LinearDRPCInputDeclarer addSharedMemory(SharedMemory request) { _component.sharedMemory.add(request); return this; }
Source:
public WorkerSlot(String nodeId, Number port) { if (port == null) throw new NullPointerException("port cannot be null"); if (nodeId == null) throw new NullPointerException("node id cannot be null"); this.nodeId = nodeId; this.port = port.intValue(); }

Target:
public WorkerSlot(String nodeId, Number port) { if (port == null) { throw new NullPointerException("port cannot be null"); } if (nodeId == null) { throw new NullPointerException("node id cannot be null"); } this.nodeId = nodeId; this.port = port.intValue(); }
Source:
public void start() { // initial delay is slightly less than the duration so that the initial tuples wont't expire due to time drift long initialDelay = duration - Math.min((long) (duration * .1), 100); executorFuture = executor.scheduleAtFixedRate(newTriggerTask(), initialDelay, duration, TimeUnit.MILLISECONDS); }

Target:
public void start() { executorFuture = executor.scheduleAtFixedRate(newTriggerTask(), duration, duration, TimeUnit.MILLISECONDS); }
Source:
public void getAutoCredentialsTest() { Map<String, Object> emptyMap = new HashMap<>(); Map<String, Object> map = new HashMap<>(); map.put(Config.TOPOLOGY_AUTO_CREDENTIALS, Arrays.asList(new String[]{"org.apache.storm.security.auth.AuthUtilsTestMock"})); Assert.assertTrue(AuthUtils.GetAutoCredentials(emptyMap).isEmpty()); Assert.assertEquals(AuthUtils.GetAutoCredentials(map).size(), 1); }

Target:
public void getAutoCredentialsTest() { Map<String, Object> map = new HashMap<>(); map.put(Config.TOPOLOGY_AUTO_CREDENTIALS, Arrays.asList(new String[]{"org.apache.storm.security.auth.AuthUtilsTestMock"})); Assert.assertTrue(AuthUtils.GetAutoCredentials(Collections.emptyMap()).isEmpty()); Assert.assertEquals(AuthUtils.GetAutoCredentials(map).size(), 1); }
Source:
public static byte[] serialize(Object obj) throws IOException { try (ByteArrayOutputStream b = new ByteArrayOutputStream()) { try (ObjectOutputStream o = new ObjectOutputStream(b)) { o.writeObject(obj); o.close(); } return b.toByteArray(); } }

Target:
public static byte[] serialize(Object obj) throws IOException { try (ByteArrayOutputStream b = new ByteArrayOutputStream()) { try (ObjectOutputStream o = new ObjectOutputStream(b)) { o.writeObject(obj); } return b.toByteArray(); } }
Source:
public List<Object> deserialize(EventData eventData) { final List<Object> fieldContents = new ArrayList<Object>(); String messageData = ""; messageData = new String (eventData.getBody(),eventData.getBodyOffset(),eventData.getBodyLength(),Charset.defaultCharset()); Map metaDataMap = eventData.getProperties(); fieldContents.add(messageData); fieldContents.add(metaDataMap); return fieldContents; }

Target:
public List<Object> deserialize(EventData eventData) { final List<Object> fieldContents = new ArrayList<Object>(); String messageData = ""; if(eventData.getBody()!=null) messageData = new String (eventData.getBody(),eventData.getBodyOffset(),eventData.getBodyLength(),Charset.defaultCharset()); Map metaDataMap = eventData.getProperties(); fieldContents.add(messageData); fieldContents.add(metaDataMap); return fieldContents; }
Source:
public void fail(Object msgId) { KafkaMessageId id = (KafkaMessageId) msgId; PartitionManager m = _coordinator.getManager(id.partition); if (m != null) { m.fail(id.offset); } { // managers for partitions changed - try to find new manager responsible for that partition PartitionManager newManager = getManagerForPartition(id.partition.partition); if (newManager != null) { newManager.fail(id.offset); } } }

Target:
public void fail(Object msgId) { KafkaMessageId id = (KafkaMessageId) msgId; PartitionManager m = _coordinator.getManager(id.partition); if (m != null) { m.fail(id.offset); } else { // managers for partitions changed - try to find new manager responsible for that partition PartitionManager newManager = getManagerForPartition(id.partition.partition); if (newManager != null) { newManager.fail(id.offset); } } }
Source:
public KafkaSpoutConfig<K,V> build() { Number maxPollRecords = (Number)kafkaProps.get(ConsumerConfig.MAX_POLL_RECORDS_CONFIG); if(maxPollRecords == null) { setMaxPollRecords(maxUncommittedOffsets); } else { setMaxPollRecords(Math.min(maxPollRecords.intValue(), maxUncommittedOffsets)); } return new KafkaSpoutConfig<>(this); }

Target:
public KafkaSpoutConfig<K,V> build() { return new KafkaSpoutConfig<>(this); }
Source:
public static PartitionAssignmentChangeListener listenerOf(final ConsumerRebalanceListener consumerRebalanceListener) { return new PartitionAssignmentChangeListener() { @Override public void onPartitionAssignmentChange(Set<TopicPartition> oldPartitions, Set<TopicPartition> newPartitions) { consumerRebalanceListener.onPartitionsRevoked(oldPartitions); consumerRebalanceListener.onPartitionsAssigned(newPartitions); } }; }

Target:
public static PartitionAssignmentChangeListener listenerOf(final ConsumerRebalanceListener consumerRebalanceListener) { return (oldPartitions, newPartitions) -> { consumerRebalanceListener.onPartitionsRevoked(oldPartitions); consumerRebalanceListener.onPartitionsAssigned(newPartitions); }; }
Source:
public void activate() { openReader(); }

Target:
public void activate() { }
Source:
public static Builder<String, String> builder(String bootstrapServers, Collection<String> topics) { return new Builder<>(bootstrapServers, new StringDeserializer(), new StringDeserializer(), topics); }

Target:
public static Builder<String, String> builder(String bootstrapServers, Collection<String> topics) { return new Builder<>(bootstrapServers, StringDeserializer.class, StringDeserializer.class, topics); }
Source:
private void subscribeKafkaConsumer() { kafkaConsumer = kafkaConsumerFactory.createConsumer(kafkaSpoutConfig); kafkaSpoutConfig.getSubscription().subscribe(kafkaConsumer, new KafkaSpoutConsumerRebalanceListener(), context); // Initial poll to get the consumer registration process going. // KafkaSpoutConsumerRebalanceListener will be called following this poll, upon partition registration kafkaConsumer.poll(0); }

Target:
private void subscribeKafkaConsumer() { kafkaConsumer = kafkaConsumerFactory.createConsumer(kafkaSpoutConfig); kafkaSpoutConfig.getSubscription().subscribe(kafkaConsumer, new KafkaSpoutConsumerRebalanceListener(), context); }
Source:
public void prepare(Map stormConfig, TopologyContext topologyContext, OutputCollector outputCollector) { this.outputCollector = outputCollector; this.stormConfig = stormConfig; Map<String, Object> cassandraClientConfig = cassandraConfig != null ? stormConfig : stormConfig; this.cassandraConf = new CassandraConf(cassandraClientConfig); this.client = clientProvider.getClient(cassandraClientConfig); try { session = client.connect(); } catch (NoHostAvailableException e) { outputCollector.reportError(e); } }

Target:
public void prepare(Map stormConfig, TopologyContext topologyContext, OutputCollector outputCollector) { this.outputCollector = outputCollector; this.stormConfig = stormConfig; Map<String, Object> cassandraClientConfig = cassandraConfig != null ? cassandraConfig : stormConfig; this.cassandraConf = new CassandraConf(cassandraClientConfig); this.client = clientProvider.getClient(cassandraClientConfig); try { session = client.connect(); } catch (NoHostAvailableException e) { outputCollector.reportError(e); } }
Source:
private static Set<String> getListOfKeysFromBlobStore(Map<String, Object> stormConf) { NimbusBlobStore client = new NimbusBlobStore(); client.prepare(stormConf); return Sets.newHashSet(client.listKeys()); }

Target:
private static Set<String> getListOfKeysFromBlobStore(Map<String, Object> stormConf) { try (NimbusBlobStore client = new NimbusBlobStore()) { client.prepare(stormConf); return Sets.newHashSet(client.listKeys()); } }
Source:
private void emit() { //Keep trying to send a tuple when requested while(!emitTupleIfNotEmitted(waitingToEmit.next()) && waitingToEmit.hasNext()) waitingToEmit.remove(); }

Target:
private void emit() { while(!emitTupleIfNotEmitted(waitingToEmit.next()) && waitingToEmit.hasNext()) { waitingToEmit.remove(); } }
Source:
void populateTopicData(String topicName, int msgCount) { kafkaUnitRule.getKafkaUnit().createTopic(topicName); IntStream.range(0, msgCount).forEach(value -> { KeyedMessage<String, String> keyedMessage = new KeyedMessage<>( topicName, ((Integer)value).toString(), ((Integer)value).toString()); kafkaUnitRule.getKafkaUnit().sendMessages(keyedMessage); }); }

Target:
void populateTopicData(String topicName, int msgCount) { kafkaUnitRule.getKafkaUnit().createTopic(topicName); IntStream.range(0, msgCount).forEach(value -> { KeyedMessage<String, String> keyedMessage = new KeyedMessage<>( topicName, Integer.toString(value), Integer.toString(value)); kafkaUnitRule.getKafkaUnit().sendMessages(keyedMessage); }); }
Source:
static public Config getConfig() { Config config = new Config(); config.setDebug(true); return config; }

Target:
public static Config getConfig() { Config config = new Config(); config.setDebug(true); return config; }
Source:
private boolean poll() { final int maxUncommittedOffsets = kafkaSpoutConfig.getMaxUncommittedOffsets(); final boolean poll = !waitingToEmit() && numUncommittedOffsets < maxUncommittedOffsets; if (!poll) { final boolean isLoggable = logTimer.isExpiredResetOnTrue(); if (isLoggable) { if (waitingToEmit()) { LOG.debug("Not polling. Tuples waiting to be emitted. uncommitted offsets across all topic partitions", numUncommittedOffsets); } if (numUncommittedOffsets >= maxUncommittedOffsets) { LOG.debug("Not polling. uncommitted offsets across all topic partitions has reached the threshold of [{}]", numUncommittedOffsets, maxUncommittedOffsets); } } } return poll; }

Target:
private boolean poll() { final int maxUncommittedOffsets = kafkaSpoutConfig.getMaxUncommittedOffsets(); final boolean poll = !waitingToEmit() && numUncommittedOffsets < maxUncommittedOffsets; if (!poll) { if (waitingToEmit()) { LOG.debug("Not polling. Tuples waiting to be emitted. uncommitted offsets across all topic partitions", numUncommittedOffsets); } if (numUncommittedOffsets >= maxUncommittedOffsets) { LOG.debug("Not polling. uncommitted offsets across all topic partitions has reached the threshold of [{}]", numUncommittedOffsets, maxUncommittedOffsets); } } return poll; }
Source:
public LSWorkerHeartbeat readHeartbeat() throws IOException { LocalState localState = ConfigUtils.workerState(_conf, _workerId); LSWorkerHeartbeat hb = localState.getWorkerHeartBeat(); LOG.warn("{}: Reading heartbeat {}", _workerId, hb); return hb; }

Target:
public LSWorkerHeartbeat readHeartbeat() throws IOException { LocalState localState = ConfigUtils.workerState(_conf, _workerId); LSWorkerHeartbeat hb = localState.getWorkerHeartBeat(); LOG.trace("{}: Reading heartbeat {}", _workerId, hb); return hb; }
Source:
public boolean areAllProcessesDead() throws IOException { Set<Long> pids = getAllPids(); String user = getWorkerUser(); boolean allDead = true; for (Long pid: pids) { if (!isProcessAlive(pid, user)) { LOG.warn("{}: PID is dead", _workerId, pid); } else { allDead = false; break; } } return allDead; }

Target:
public boolean areAllProcessesDead() throws IOException { Set<Long> pids = getAllPids(); String user = getWorkerUser(); boolean allDead = true; for (Long pid: pids) { if (!isProcessAlive(pid, user)) { LOG.debug("{}: PID is dead", _workerId, pid); } else { allDead = false; break; } } return allDead; }
Source:
public static String workerPidPath(Map<String, Object> conf, String id, long pid) { return (workerPidsRoot(conf, id) + FILE_SEPARATOR + pid); }

Target:
public static String workerPidPath(Map<String, Object> conf, String id, long pid) { return workerPidPath(conf, id, String.valueOf(pid)); }
Source:
public KinesisConnectionInfo (AWSCredentialsProvider credentialsProvider, ClientConfiguration clientConfiguration, Regions region, Integer recordsLimit) { if (recordsLimit == null || recordsLimit <= 0) { throw new IllegalArgumentException("recordsLimit has to be a positive integer"); } if (region == null) { throw new IllegalArgumentException("region cannot be null"); } serializedKinesisCredsProvider = getKryoSerializedBytes(credentialsProvider); serializedkinesisClientConfig = getKryoSerializedBytes(clientConfiguration); this.recordsLimit = recordsLimit; this.region = region; this.credentialsProvider = null; this.clientConfiguration = null; }

Target:
public KinesisConnectionInfo (AWSCredentialsProvider credentialsProvider, ClientConfiguration clientConfiguration, Regions region, Integer recordsLimit) { if (recordsLimit == null || recordsLimit <= 0) { throw new IllegalArgumentException("recordsLimit has to be a positive integer"); } if (region == null) { throw new IllegalArgumentException("region cannot be null"); } serializedKinesisCredsProvider = getKryoSerializedBytes(credentialsProvider); serializedkinesisClientConfig = getKryoSerializedBytes(clientConfiguration); this.recordsLimit = recordsLimit; this.region = region; }
Source:
public void testDefaults() { SimpleFileNameFormat format = new SimpleFileNameFormat(); format.prepare(null, createTopologyContext()); String path = format.getPath(); String name = format.getName(1, System.currentTimeMillis()); Assert.assertEquals("/storm", path); String now = new SimpleDateFormat("yyyyMMddHHmmss").format(System.currentTimeMillis()); Assert.assertEquals(now+".1.txt", name); }

Target:
public void testDefaults() { SimpleFileNameFormat format = new SimpleFileNameFormat(); format.prepare(null, createTopologyContext()); long now = System.currentTimeMillis(); String path = format.getPath(); String name = format.getName(1, now); Assert.assertEquals("/storm", path); String time = new SimpleDateFormat("yyyyMMddHHmmss").format(now); Assert.assertEquals(time+".1.txt", name); }
Source:
public BaseWindowedBolt withLateTupleStream(String streamId) { if (!windowConfiguration.containsKey(Config.TOPOLOGY_BOLTS_TUPLE_TIMESTAMP_FIELD_NAME)) { throw new IllegalArgumentException("Timestamp field should be specified before specifying stream for late tuples"); } windowConfiguration.put(Config.TOPOLOGY_BOLTS_LATE_TUPLE_STREAM, streamId); return this; }

Target:
public BaseWindowedBolt withLateTupleStream(String streamId) { windowConfiguration.put(Config.TOPOLOGY_BOLTS_LATE_TUPLE_STREAM, streamId); return this; }
Source:
public void declareOutputFields(OutputFieldsDeclarer declarer) { bolt.declareOutputFields(declarer); super.declareCheckpointStream(declarer); }

Target:
public void declareOutputFields(OutputFieldsDeclarer declarer) { bolt.declareOutputFields(declarer); declareCheckpointStream(declarer); }
Source:
private boolean isFilteredIn(String metricName) { if (noneSpecified) { return true; } if (!whitelistPattern.isEmpty()) { return checkMatching(metricName, whitelistPattern, true); } else if (!blacklistPattern.isEmpty()) { return checkMatching(metricName, blacklistPattern, false); } throw new IllegalStateException("Shouldn't reach here"); }

Target:
private boolean isFilteredIn(String metricName) { if (!whitelistPattern.isEmpty()) { return checkMatching(metricName, whitelistPattern, true); } else if (!blacklistPattern.isEmpty()) { return checkMatching(metricName, blacklistPattern, false); } throw new IllegalStateException("Shouldn't reach here"); }
Source:
public boolean isWorkerHbTimedOutImpl(int now, LSWorkerHeartbeat whb, Map conf) { boolean result = false; if ((now - whb.get_time_secs()) > Utils.getInt(conf.get(Config.SUPERVISOR_WORKER_TIMEOUT_SECS))) { result = true; } return result; }

Target:
public boolean isWorkerHbTimedOutImpl(int now, LSWorkerHeartbeat whb, Map conf) { return (now - whb.get_time_secs()) > Utils.getInt(conf.get(Config.SUPERVISOR_WORKER_TIMEOUT_SECS)); }
Source:
public final static List<ACL> supervisorZkAcls() { final List<ACL> acls = new ArrayList<>(); acls.add(ZooDefs.Ids.CREATOR_ALL_ACL.get(0)); acls.add(new ACL((ZooDefs.Perms.READ ^ ZooDefs.Perms.CREATE), ZooDefs.Ids.ANYONE_ID_UNSAFE)); return acls; }

Target:
public static List<ACL> supervisorZkAcls() { final List<ACL> acls = new ArrayList<>(); acls.add(ZooDefs.Ids.CREATOR_ALL_ACL.get(0)); acls.add(new ACL((ZooDefs.Perms.READ ^ ZooDefs.Perms.CREATE), ZooDefs.Ids.ANYONE_ID_UNSAFE)); return acls; }
Source:
private void launchChannelAliveThread() { // netty TimerTask is already defined and hence a fully // qualified name timer.schedule(new java.util.TimerTask() { public void run() { try { LOG.debug("running timer task, address {}", dstAddress); if(closing) { this.cancel(); } getConnectedChannel(); } catch (Exception exp) { LOG.error("channel connection error {}", exp); } } }, 0, CHANNEL_ALIVE_INTERVAL_MS); }

Target:
private void launchChannelAliveThread() { // netty TimerTask is already defined and hence a fully // qualified name timer.schedule(new java.util.TimerTask() { public void run() { try { LOG.debug("running timer task, address {}", dstAddress); if(closing) { this.cancel(); return; } getConnectedChannel(); } catch (Exception exp) { LOG.error("channel connection error {}", exp); } } }, 0, CHANNEL_ALIVE_INTERVAL_MS); }
Source:
protected Map<String, StormBase> topologyBasesImpl(IStormClusterState stormClusterState) { List<String> activeTopologys = stormClusterState.activeStorms(); Map<String, StormBase> stormBases = new HashMap<String, StormBase>(); if (activeTopologys != null) { for (String topologyId : activeTopologys) { StormBase base = stormClusterState.stormBase(topologyId, null); if (base != null) { stormBases.put(topologyId, base); } } } return stormBases; }

Target:
protected Map<String, StormBase> topologyBasesImpl(IStormClusterState stormClusterState) { List<String> activeTopologys = stormClusterState.activeStorms(); Map<String, StormBase> stormBases = new HashMap<String, StormBase>(); for (String topologyId : activeTopologys) { StormBase base = stormClusterState.stormBase(topologyId, null); stormBases.put(topologyId, base); } return stormBases; }
Source:
public static Map componentConf(Object component) { Map<Object, Object> conf = new HashMap<Object, Object>(); ComponentCommon common = getComponentCommon(component); if (common != null) { String jconf = common.get_json_conf(); if (jconf != null) { conf.putAll((Map<Object, Object>) JSONValue.parse(jconf)); } } return conf; }

Target:
public static Map componentConf(Object component) { Map<Object, Object> conf = new HashMap<Object, Object>(); ComponentCommon common = getComponentCommon(component); String jconf = common.get_json_conf(); if (jconf != null) { conf.putAll((Map<Object, Object>) JSONValue.parse(jconf)); } return conf; }
Source:
private static boolean isEmptyInputs(ComponentCommon common) { if (common == null) { return true; } else if (common.get_inputs() == null) { return true; } else { return common.get_inputs().isEmpty(); } }

Target:
private static boolean isEmptyInputs(ComponentCommon common) { if (common.get_inputs() == null) { return true; } else { return common.get_inputs().isEmpty(); } }
Source:
private static Set<String> getStreamOutputFields(Map<String, StreamInfo> streams) { Set<String> outputFields = new HashSet<String>(); if (streams != null) { for (StreamInfo streamInfo : streams.values()) { outputFields.addAll(streamInfo.get_output_fields()); } } return outputFields; }

Target:
private static Set<String> getStreamOutputFields(Map<String, StreamInfo> streams) { Set<String> outputFields = new HashSet<String>(); for (StreamInfo streamInfo : streams.values()) { outputFields.addAll(streamInfo.get_output_fields()); } return outputFields; }
Source:
public static ComponentCommon getComponentCommon(Object component) { if (component == null) { return null; } ComponentCommon common = null; if (component instanceof StateSpoutSpec) { common = ((StateSpoutSpec) component).get_common(); } else if (component instanceof SpoutSpec) { common = ((SpoutSpec) component).get_common(); } else if (component instanceof Bolt) { common = ((Bolt) component).get_common(); } return common; }

Target:
public static ComponentCommon getComponentCommon(Object component) { ComponentCommon common = null; if (component instanceof StateSpoutSpec) { common = ((StateSpoutSpec) component).get_common(); } else if (component instanceof SpoutSpec) { common = ((SpoutSpec) component).get_common(); } else if (component instanceof Bolt) { common = ((Bolt) component).get_common(); } return common; }
Source:
public static void addMetricStreams(StormTopology topology) { for (Object component : allComponents(topology).values()) { ComponentCommon common = getComponentCommon(component); if (common != null) { StreamInfo streamInfo = Thrift.outputFields(Arrays.asList("task-info", "data-points")); common.put_to_streams(Constants.METRICS_STREAM_ID, streamInfo); } } }

Target:
public static void addMetricStreams(StormTopology topology) { for (Object component : allComponents(topology).values()) { ComponentCommon common = getComponentCommon(component); StreamInfo streamInfo = Thrift.outputFields(Arrays.asList("task-info", "data-points")); common.put_to_streams(Constants.METRICS_STREAM_ID, streamInfo); } }
Source:
public static void addSystemStreams(StormTopology topology) { for (Object component : allComponents(topology).values()) { ComponentCommon common = getComponentCommon(component); if (common != null) { StreamInfo streamInfo = Thrift.outputFields(Arrays.asList("event")); common.put_to_streams(SYSTEM_STREAM_ID, streamInfo); } } }

Target:
public static void addSystemStreams(StormTopology topology) { for (Object component : allComponents(topology).values()) { ComponentCommon common = getComponentCommon(component); StreamInfo streamInfo = Thrift.outputFields(Arrays.asList("event")); common.put_to_streams(SYSTEM_STREAM_ID, streamInfo); } }
Source:
public static int numStartExecutors(Object component) throws InvalidTopologyException { ComponentCommon common = getComponentCommon(component); if (common == null) { throw new InvalidTopologyException("unknown component type " + component.getClass().getName()); } int parallelismHintNum = Thrift.getParallelismHint(common); return parallelismHintNum; }

Target:
public static int numStartExecutors(Object component) throws InvalidTopologyException { ComponentCommon common = getComponentCommon(component); return Thrift.getParallelismHint(common); }
Source:
public void setCurrAssignment(Map<Long, LocalAssignment> currAssignment) { this.currAssignment.clear(); this.currAssignment.putAll(currAssignment); }

Target:
public void setCurrAssignment(Map<Long, LocalAssignment> currAssignment) { this.currAssignment.set(currAssignment); }
Source:
public void setAssignmentVersions(Map<String, Map<String, Object>> assignmentVersions) { this.assignmentVersions.clear(); this.assignmentVersions.putAll(assignmentVersions); }

Target:
public void setAssignmentVersions(Map<String, Map<String, Object>> assignmentVersions) { this.assignmentVersions.set(assignmentVersions); }
Source:
public static List<ACL> supervisorZkAcls() { List<ACL> acls = new ArrayList<>(); acls.add(ZooDefs.Ids.CREATOR_ALL_ACL.get(0)); acls.add(new ACL((ZooDefs.Perms.READ ^ ZooDefs.Perms.CREATE), ZooDefs.Ids.ANYONE_ID_UNSAFE)); return acls; }

Target:
public final static List<ACL> supervisorZkAcls() { final List<ACL> acls = new ArrayList<>(); acls.add(ZooDefs.Ids.CREATOR_ALL_ACL.get(0)); acls.add(new ACL((ZooDefs.Perms.READ ^ ZooDefs.Perms.CREATE), ZooDefs.Ids.ANYONE_ID_UNSAFE)); return acls; }
Source:
private void registerWorkerNumGauge(String name, final Map conf) { StormMetricsRegistry.registerGauge("supervisor:num-slots-used-gauge", new Callable<Integer>() { @Override public Integer call() throws Exception { Collection<String> pids = SupervisorUtils.supervisorWorkerIds(conf); return pids.size(); } }); }

Target:
private void registerWorkerNumGauge(String name, final Map conf) { StormMetricsRegistry.registerGauge(name, new Callable<Integer>() { @Override public Integer call() throws Exception { Collection<String> pids = SupervisorUtils.supervisorWorkerIds(conf); return pids.size(); } }); }
Source:
private static Server removeNonSslConnector(Server server) { for (Connector c : server.getConnectors()) { if (c != null && c instanceof SslSocketConnector) { server.removeConnector(c); } } return server; }

Target:
private static Server removeNonSslConnector(Server server) { for (Connector c : server.getConnectors()) { if (c != null && !(c instanceof SslSocketConnector)) { server.removeConnector(c); } } return server; }
Source:
public void isZkAuthenticationConfiguredStormServerWithPropertyTest() { String key = "java.security.auth.login.config"; String oldValue = System.getProperty(key); try { System.setProperty("java.security.auth.login.config", "anything"); Assert.assertTrue(Utils.isZkAuthenticationConfiguredStormServer(emptyMockMap())); } catch (Exception ignore) { } finally { // reset property if (oldValue == null) { System.clearProperty(key); } else { System.setProperty(key, oldValue); } } }

Target:
public void isZkAuthenticationConfiguredStormServerWithPropertyTest() { String key = "java.security.auth.login.config"; String oldValue = System.getProperty(key); try { System.setProperty("java.security.auth.login.config", "anything"); Assert.assertTrue(Utils.isZkAuthenticationConfiguredStormServer(emptyMockMap())); } finally { // reset property if (oldValue == null) { System.clearProperty(key); } else { System.setProperty(key, oldValue); } } }
Source:
public void isSimulatingReturnsTrueDuringSimulationTest() { Assert.assertFalse(Time.isSimulating()); Time.startSimulating(); Assert.assertTrue(Time.isSimulating()); Time.stopSimulating(); }

Target:
public void isSimulatingReturnsTrueDuringSimulationTest() { Assert.assertFalse(Time.isSimulating()); Time.startSimulating(); try { Assert.assertTrue(Time.isSimulating()); } finally { Time.stopSimulating(); } }
Source:
public void checkActive() { if (!this.task.isActive()) { throw new IllegalStateException("Timer is not active"); } }

Target:
private void checkActive() { if (!this.task.isActive()) { throw new IllegalStateException("Timer is not active"); } }
Source:
public static Object newInstance(String klass) { try { LOG.info("Creating new instance for class {}", klass); return newInstance(Class.forName(klass)); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public static <T> T newInstance(String klass) { try { return newInstance((Class<T>)Class.forName(klass)); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public static String eventLogsFilename(String stormId, int port) { return stormId + FILE_PATH_SEPARATOR + Integer.toString(port) + FILE_PATH_SEPARATOR + "events.log"; }

Target:
public static String eventLogsFilename(String stormId, int port) { return stormId + FILE_PATH_SEPARATOR + port + FILE_PATH_SEPARATOR + "events.log"; }
Source:
public static Map redactValue(Map<Object, String> m, Object key) { if(m.containsKey(key)) { HashMap<Object, String> newMap = new HashMap<>(m); String value = newMap.get(key); String redacted = new String(new char[value.length()]).replace("\0", "#"); newMap.put(key, redacted); return newMap; } return m; }

Target:
public static Map<Object, String> redactValue(Map<Object, String> m, Object key) { if(m.containsKey(key)) { HashMap<Object, String> newMap = new HashMap<>(m); String value = newMap.get(key); String redacted = new String(new char[value.length()]).replace("\0", "#"); newMap.put(key, redacted); return newMap; } return m; }
Source:
public static String processPid() throws RuntimeException { String name = ManagementFactory.getRuntimeMXBean().getName(); String[] split = name.split("@"); if (split.length != 2) { throw new RuntimeException("Got unexpected process name: " + name); } return split[0]; }

Target:
public static String processPid() { String name = ManagementFactory.getRuntimeMXBean().getName(); String[] split = name.split("@"); if (split.length != 2) { throw new RuntimeException("Got unexpected process name: " + name); } return split[0]; }
Source:
public static int forceKillProcess (String pid) { return sendSignalToProcess(Long.parseLong(pid), SIGKILL); }

Target:
public static void forceKillProcess (String pid) throws IOException { sendSignalToProcess(Long.parseLong(pid), SIGKILL); }
Source:
public static String shellCmd (List<String> command) { List<String> changedCommands = new LinkedList<>(); for (String str: command) { if (str == null) { continue; } changedCommands.add("'" + str.replaceAll("'", "'\"'\"'") + "'"); } return StringUtils.join(changedCommands, " "); }

Target:
public static String shellCmd (List<String> command) { List<String> changedCommands = new ArrayList<>(command.size()); for (String str: command) { if (str == null) { continue; } changedCommands.add("'" + str.replaceAll("'", "'\"'\"'") + "'"); } return StringUtils.join(changedCommands, " "); }
Source:
public void shutdown() { try { log.info("window manager is being shutdown", windowManager); windowManager.shutdown(); } finally { log.info("window store is being shutdown", windowStore); windowStore.shutdown(); } }

Target:
public void shutdown() { try { LOG.info("window manager is being shutdown", windowManager); windowManager.shutdown(); } finally { LOG.info("window store is being shutdown", windowStore); windowStore.shutdown(); } }
Source:
public boolean equals(Object object) { boolean ret = false; if (object != null && object instanceof SubSystem) { ret = (this.type.equals(((SubSystem)object).getType()) && this.hierarchyID == ((SubSystem)object).getHierarchyID()); } return ret; }

Target:
public boolean equals(Object object) { boolean ret = false; if (object != null && object instanceof SubSystem) { ret = ((this.type == ((SubSystem)object).getType()) && (this.hierarchyID == ((SubSystem)object).getHierarchyID())); } return ret; }
Source:
public synchronized static CgroupCenter getInstance() { if (instance == null) { instance = new CgroupCenter(); } return CgroupUtils.enabled() ? instance : null; }

Target:
public synchronized static CgroupCenter getInstance() { if (CgroupUtils.enabled()) { instance = new CgroupCenter(); return instance; } return null; }
Source:
public boolean isMounted(Hierarchy hierarchy) { List<Hierarchy> hierarchies = this.getHierarchies(); if (Utils.CheckDirExists(hierarchy.getDir())) { for (Hierarchy h : hierarchies) { if (h.equals(hierarchy)) { return true; } } } return false; }

Target:
public boolean isMounted(Hierarchy hierarchy) { if (Utils.CheckDirExists(hierarchy.getDir())) { List<Hierarchy> hierarchies = this.getHierarchies(); for (Hierarchy h : hierarchies) { if (h.equals(hierarchy)) { return true; } } } return false; }
Source:
public static void deleteDir(String dir) { File d = new File(dir); if (d.exists()) { if (d.isDirectory()) { if (!d.delete()) { throw new RuntimeException("Cannot delete dir " + dir); } } else { throw new RuntimeException("dir " + dir + " is not a directory!"); } } else { LOG.warn("dir does not exist!", dir); } }

Target:
public static void deleteDir(String dir) { File d = new File(dir); if (!d.exists()) { LOG.warn("dir does not exist!", dir); return; } if (!d.isDirectory()) { throw new RuntimeException("dir " + dir + " is not a directory!"); } if (!d.delete()) { throw new RuntimeException("Cannot delete dir " + dir); } }
Source:
public static SubSystemType getSubSystem(String str) { switch (str) { case "blkio": return blkio; case "cpu": return cpu; case "cpuacct": return cpuacct; case "devices": return devices; case "freezer": return freezer; case "memory": return memory; case "perf_event": return perf_event; case "net_cls": return net_cls; case "net_prio": return net_prio; default: return null; } }

Target:
public static SubSystemType getSubSystem(String str) { try { return SubSystemType.valueOf(str); } catch (Exception e) { return null; } }
Source:
public void prepare(Map conf) { LOG.info("no-op for zookeeper implementation"); }

Target:
public void prepare(Map conf) { // no-op for zookeeper implementation }
Source:
public void removeFromLeaderLockQueue() { if (LeaderLatch.State.STARTED.equals(leaderLatch.get().getState())) { try { leaderLatch.get().close(); LOG.info("Removed from leader lock queue."); } catch (IOException e) { LOG.warn("failed to close leaderLatch!!"); } } else { LOG.info("leader latch is not started so no removeFromLeaderLockQueue needed."); } }

Target:
public void removeFromLeaderLockQueue() throws Exception { if (LeaderLatch.State.STARTED.equals(leaderLatch.get().getState())) { leaderLatch.get().close(); LOG.info("Removed from leader lock queue."); } else { LOG.info("leader latch is not started so no removeFromLeaderLockQueue needed."); } }
Source:
public static String absoluteHealthCheckDir(Map conf) { String stormHome = System.getProperty("storm.home"); String healthCheckDir = String.valueOf(conf.get(Config.STORM_HEALTH_CHECK_DIR)); if (healthCheckDir.equals("null")) { return (stormHome + FILE_SEPARATOR + "healthchecks"); } else { if (new File(healthCheckDir).isAbsolute()) { return healthCheckDir; } else { return (stormHome + FILE_SEPARATOR + healthCheckDir); } } }

Target:
public static String absoluteHealthCheckDir(Map conf) { String stormHome = System.getProperty("storm.home"); String healthCheckDir = (String) conf.get(Config.STORM_HEALTH_CHECK_DIR); if (healthCheckDir == null) { return (stormHome + FILE_SEPARATOR + "healthchecks"); } else { if (new File(healthCheckDir).isAbsolute()) { return healthCheckDir; } else { return (stormHome + FILE_SEPARATOR + healthCheckDir); } } }
Source:
public static String masterLocalDir(Map conf) throws IOException { String ret = String.valueOf(conf.get(Config.STORM_LOCAL_DIR)) + FILE_SEPARATOR + "nimbus"; try { FileUtils.forceMkdir(new File(ret)); } catch (IOException e) { LOG.error("Failed to create dir " + ret, e); throw e; } return ret; }

Target:
public static String masterLocalDir(Map conf) throws IOException { String ret = String.valueOf(conf.get(Config.STORM_LOCAL_DIR)) + FILE_SEPARATOR + "nimbus"; FileUtils.forceMkdir(new File(ret)); return ret; }
Source:
public static String supervisorIsupervisorDir(Map conf) throws IOException { return ((supervisorLocalDir(conf) + FILE_SEPARATOR + "isupervisor")); }

Target:
public static String supervisorIsupervisorDir(Map conf) throws IOException { return (supervisorLocalDir(conf) + FILE_SEPARATOR + "isupervisor"); }
Source:
public String getId() { return this.getNodeId() + ":" + this.getPort(); }

Target:
public String getId() { return getNodeId() + ":" + getPort(); }
Source:
public double getMemoryUsedByWorker(WorkerSlot ws) { TopologyDetails topo = findTopologyUsingWorker(ws); if (topo == null) { return 0.0; } Collection<ExecutorDetails> execs = getExecutors(ws, _cluster); LOG.info("getMemoryUsedByWorker executors: {}", execs); double totalMemoryUsed = 0.0; for (ExecutorDetails exec : execs) { totalMemoryUsed += topo.getTotalMemReqTask(exec); } return totalMemoryUsed; }

Target:
public double getMemoryUsedByWorker(WorkerSlot ws) { TopologyDetails topo = findTopologyUsingWorker(ws); if (topo == null) { return 0.0; } Collection<ExecutorDetails> execs = getExecutors(ws, _cluster); double totalMemoryUsed = 0.0; for (ExecutorDetails exec : execs) { totalMemoryUsed += topo.getTotalMemReqTask(exec); } return totalMemoryUsed; }
Source:
public void initState(KeyValueState<String, Long> state) { this.state = state; sum = state.get("sum", 0L); System.out.println("initState with state [" + state + "] current sum [" + sum + "]"); }

Target:
public void initState(KeyValueState<String, Long> state) { this.state = state; sum = state.get("sum", 0L); LOG.debug("initState with state [" + state + "] current sum [" + sum + "]"); }
Source:
private void setupCommitElapseTimer() { if(commitFrequencySec<=0) return; TimerTask timerTask = new TimerTask() { @Override public void run() { commitTimeElapsed.set(false); } }; commitTimer.schedule(timerTask, commitFrequencySec * 1000); }

Target:
private void setupCommitElapseTimer() { if(commitFrequencySec<=0) { return; } TimerTask timerTask = new TimerTask() { @Override public void run() { commitTimeElapsed.set(true); } }; commitTimer.schedule(timerTask, commitFrequencySec * 1000); }
Source:
public String toString() { String ret = "Topologies:\n"; for (TopologyDetails td : this.getTopologies()) { ret += td.toString() + "\n"; } return ret; }

Target:
public String toString() { StringBuilder ret = new StringBuilder(); ret.append("Topologies:\n"); for (TopologyDetails td : this.getTopologies()) { ret.append(td.toString()).append("\n"); } return ret.toString(); }
Source:
public String toString() { String ret = ""; if(this.isSuccess()) { ret += "Status: " + this.getStatus() + " message: " + this.getMessage() + " scheduling: " + this.getSchedulingResultMap().toString(); } else { ret += "Status: " + this.getStatus() + " error message: " + this.getErrorMessage(); } return ret; }

Target:
public String toString() { String ret = null; if(this.isSuccess()) { ret = "Status: " + this.getStatus() + " message: " + this.getMessage() + " scheduling: " + this.getSchedulingResultMap(); } else { ret = "Status: " + this.getStatus() + " error message: " + this.getErrorMessage(); } return ret; }
Source:
public void setAssignments(Map<String, SchedulerAssignment> newAssignments) { this.assignments = new HashMap<String, SchedulerAssignmentImpl>(); for (Map.Entry<String, SchedulerAssignment> entry : newAssignments.entrySet()) { this.assignments.put(entry.getKey(), new SchedulerAssignmentImpl(entry.getValue().getTopologyId(), entry.getValue().getExecutorToSlot())); } }

Target:
public void setAssignments(Map<String, SchedulerAssignment> newAssignments) { this.assignments = new HashMap<String, SchedulerAssignmentImpl>(newAssignments.size()); for (Map.Entry<String, SchedulerAssignment> entry : newAssignments.entrySet()) { this.assignments.put(entry.getKey(), new SchedulerAssignmentImpl(entry.getValue().getTopologyId(), entry.getValue().getExecutorToSlot())); } }
Source:
public void setStatusMap(Map<String, String> statusMap) { this.status.putAll(statusMap); }

Target:
public void setStatusMap(Map<String, String> statusMap) { this.status.clear(); this.status.putAll(statusMap); }
Source:
public Double getTotalCPU() { Double totalCPU = getTotalResource(Config.SUPERVISOR_CPU_CAPACITY); if (totalCPU == null) { throw new IllegalStateException("default value for supervisor.cpu.capacity is not set!"); } return totalCPU; }

Target:
public Double getTotalCPU() { Double totalCPU = getTotalResource(Config.SUPERVISOR_CPU_CAPACITY); assert totalCPU != null; return totalCPU; }
Source:
public TopologyDetails(String topologyId, Map topologyConf, StormTopology topology, int numWorkers, Map<ExecutorDetails, String> executorToComponents) { this(topologyId, topologyConf, topology, numWorkers); this.executorToComponent = new HashMap<>(0); if (executorToComponents != null) { this.executorToComponent.putAll(executorToComponents); } this.initResourceList(); this.initConfigs(); }

Target:
public TopologyDetails(String topologyId, Map topologyConf, StormTopology topology, int numWorkers, Map<ExecutorDetails, String> executorToComponents) { this(topologyId, topologyConf, topology, numWorkers, executorToComponents, 0); }
Source:
public Map<WorkerSlot, Collection<ExecutorDetails>> getSchedulingResultMap() { return schedulingResultMap; }

Target:
public Map<WorkerSlot, Collection<ExecutorDetails>> getSchedulingResultMap() { return this.schedulingResultMap; }
Source:
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.windowedOutputCollector = new WindowedOutputCollector(collector); bolt.prepare(stormConf, context, windowedOutputCollector); this.listener = newWindowLifecycleListener(); this.windowManager = initWindowManager(listener, stormConf); LOG.info("Initialized window manager ", this.windowManager); }

Target:
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.windowedOutputCollector = new WindowedOutputCollector(collector); bolt.prepare(stormConf, context, windowedOutputCollector); this.listener = newWindowLifecycleListener(); this.windowManager = initWindowManager(listener, stormConf); LOG.debug("Initialized window manager ", this.windowManager); }
Source:
private Set<String> constructUserFromPrincipals(Subject who) { Set<String> user = new HashSet<String>(); if (who == null) { LOG.debug("in validate acl who is null"); } else { LOG.debug("in validate acl: " + who); } if (who != null) { for (Principal p : who.getPrincipals()) { user.add(_ptol.toLocal(p)); } } return user; }

Target:
private Set<String> constructUserFromPrincipals(Subject who) { Set<String> user = new HashSet<String>(); if (who != null) { for (Principal p : who.getPrincipals()) { user.add(_ptol.toLocal(p)); } } return user; }
Source:
public static final void validateKey(String key) throws AuthorizationException { if (key == null || key.isEmpty() || "..".equals(key) || ".".equals(key) || !KEY_PATTERN.matcher(key).matches()) { LOG.error("'{}' does not appear to be valid {}", key, KEY_PATTERN); throw new AuthorizationException(key+" does not appear to be a valid blob key"); } }

Target:
public static final void validateKey(String key) { if (StringUtils.isEmpty(key) || "..".equals(key) || ".".equals(key) || !KEY_PATTERN.matcher(key).matches()) { LOG.error("'{}' does not appear to be valid {}", key, KEY_PATTERN); throw new IllegalArgumentException(key+" does not appear to be a valid blob key"); } }
Source:
private void incrementMaxSequenceNumber(CuratorFramework zkClient, int count) throws Exception { zkClient.setData().forPath(BLOBSTORE_MAX_KEY_SEQUENCE_SUBTREE + "/" + key, ByteBuffer.allocate(INT_CAPACITY).putInt(count++).array()); }

Target:
private void incrementMaxSequenceNumber(CuratorFramework zkClient, int count) throws Exception { zkClient.setData().forPath(BLOBSTORE_MAX_KEY_SEQUENCE_SUBTREE + "/" + key, ByteBuffer.allocate(INT_CAPACITY).putInt(count + 1).array()); }
Source:
public static final void validateKey(String key) { if (key == null || key.isEmpty() || "..".equals(key) || ".".equals(key) || !KEY_PATTERN.matcher(key).matches()) { LOG.error("'{}' does not appear to be valid {}", key, KEY_PATTERN); throw new IllegalArgumentException(key+" does not appear to be a valid blob key"); } }

Target:
public static final void validateKey(String key) { if (StringUtils.isEmpty(key) || "..".equals(key) || ".".equals(key) || !KEY_PATTERN.matcher(key).matches()) { LOG.error("'{}' does not appear to be valid {}", key, KEY_PATTERN); throw new IllegalArgumentException(key+" does not appear to be a valid blob key"); } }