Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.Map;

/**
*
*/
public class ConfigProvider<T> implements Provider<T>
{
Expand Down Expand Up @@ -79,7 +80,7 @@ public T get()
{
try {
// ConfigMagic handles a null replacements
Preconditions.checkNotNull(factory, "WTF!? Code misconfigured, inject() didn't get called.");
Preconditions.checkNotNull(factory, "Code misconfigured, inject() didn't get called.");
return factory.buildWithReplacements(clazz, replacements);
}
catch (IllegalArgumentException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private int verifySize(long bytesWrittenInChunk)
bytesWritten += bytesWrittenInChunk;

if (bytesWritten != currOut.getCurrOffset() - startOffset) {
throw new ISE("WTF? Perhaps there is some concurrent modification going on?");
throw new ISE("Perhaps there is some concurrent modification going on?");
}
if (bytesWritten > size) {
throw new ISE("Wrote[%,d] bytes for something of size[%,d]. Liar!!!", bytesWritten, size);
Expand All @@ -228,7 +228,7 @@ public void close() throws IOException
writerCurrentlyInUse = false;

if (bytesWritten != currOut.getCurrOffset() - startOffset) {
throw new ISE("WTF? Perhaps there is some concurrent modification going on?");
throw new ISE("Perhaps there is some concurrent modification going on?");
}
if (bytesWritten != size) {
throw new IOE("Expected [%,d] bytes, only saw [%,d], potential corruption?", size, bytesWritten);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,6 @@ public void assertionError(String message, Object... formatArgs)
log.error("ASSERTION_ERROR: " + message, formatArgs);
}

public void wtf(String message, Object... formatArgs)
{
error(message, formatArgs);
}

public void wtf(Throwable t, String message, Object... formatArgs)
{
error(t, message, formatArgs);
}

public void debugSegments(@Nullable final Collection<DataSegment> segments, @Nullable String preamble)
{
if (log.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ V get()
deficit--;
poolVal = null;
} else {
throw new IllegalStateException("WTF?! No objects left, and no object deficit. This is probably a bug.");
throw new IllegalStateException("Unexpected state: No objects left, and no object deficit");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public ClientResponse<InputStream> done(ClientResponse<InputStream> clientRespon
}
catch (IOException e) {
// This should never happen
log.wtf(e, "The empty stream threw an IOException");
log.error(e, "The empty stream threw an IOException");
throw new RuntimeException(e);
}
finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ private List<AtomicUpdateGroup<T>> findOvershadowedBy(
* @param minorVersion the minor version to check overshadow relation. The found groups will have lower minor versions
* than this.
* @param fromState the state to search for overshadowed groups.
*
* @return a list of found atomicUpdateGroups. It could be empty if no groups are found.
*/
@VisibleForTesting
Expand Down Expand Up @@ -333,6 +334,7 @@ private List<AtomicUpdateGroup<T>> findOvershadows(AtomicUpdateGroup<T> aug, Sta
* @param minorVersion the minor version to check overshadow relation. The found groups will have higher minor
* versions than this.
* @param fromState the state to search for overshadowed groups.
*
* @return a list of found atomicUpdateGroups. It could be empty if no groups are found.
*/
@VisibleForTesting
Expand Down Expand Up @@ -438,9 +440,9 @@ private void determineVisibleGroupAfterAdd(AtomicUpdateGroup<T> aug, State state
* The given standby group can be visible in the below two cases:
*
* - The standby group is full. Since every standby group has a higher version than the current visible group,
* it should become visible immediately when it's full.
* it should become visible immediately when it's full.
* - The standby group is not full but not empty and the current visible is not full. If there's no fully available
* group, the group of the highest version should be the visible.
* group, the group of the highest version should be the visible.
*/
private void moveNewStandbyToVisibleIfNecessary(AtomicUpdateGroup<T> standbyGroup, State stateOfGroup)
{
Expand Down Expand Up @@ -530,7 +532,7 @@ private void checkVisibleIsFullyAvailableAndTryToMoveOvershadowedToVisible(
findOvershadows(group, State.STANDBY)
);
if (overshadowingStandbys.isEmpty()) {
throw new ISE("WTH? atomicUpdateGroup[%s] is in overshadowed state, but no one overshadows it?", group);
throw new ISE("Unexpected state: atomicUpdateGroup[%s] is overshadowed, but nothing overshadows it", group);
}
groupsOvershadowingAug = overshadowingStandbys;
isOvershadowingGroupsFull = false;
Expand Down Expand Up @@ -585,6 +587,7 @@ private void checkVisibleIsFullyAvailableAndTryToMoveOvershadowedToVisible(
* @param groups atomicUpdateGroups sorted by their rootPartitionRange
* @param startRootPartitionId the start partitionId of the root partition range to check the coverage
* @param endRootPartitionId the end partitionId of the root partition range to check the coverage
*
* @return true if the given groups fully cover the given partition range.
*/
private boolean doGroupsFullyCoverPartitionRange(
Expand Down Expand Up @@ -675,7 +678,7 @@ boolean addChunk(PartitionChunk<T> chunk)
// If this chunk is already in the atomicUpdateGroup, it should be in knownPartitionChunks
// and this code must not be executed.
throw new ISE(
"WTH? chunk[%s] is in the atomicUpdateGroup[%s] but not in knownPartitionChunks[%s]?",
"Unexpected state: chunk[%s] is in the atomicUpdateGroup[%s] but not in knownPartitionChunks[%s]",
chunk,
atomicUpdateGroup,
knownPartitionChunks
Expand Down Expand Up @@ -875,7 +878,7 @@ private void removeFrom(AtomicUpdateGroup<T> aug, State state)

if (!removed.equals(aug)) {
throw new ISE(
"WTH? actually removed atomicUpdateGroup[%s] is different from the one which is supposed to be[%s]",
"Unexpected state: Removed atomicUpdateGroup[%s] is different from expected atomicUpdateGroup[%s]",
removed,
aug
);
Expand All @@ -896,7 +899,7 @@ PartitionChunk<T> removeChunk(PartitionChunk<T> partitionChunk)

if (!knownChunk.equals(partitionChunk)) {
throw new ISE(
"WTH? Same partitionId[%d], but known partition[%s] is different from the input partition[%s]",
"Unexpected state: Same partitionId[%d], but known partition[%s] is different from the input partition[%s]",
partitionChunk.getChunkNumber(),
knownChunk,
partitionChunk
Expand Down Expand Up @@ -932,7 +935,8 @@ public boolean isComplete()
(SingleEntryShort2ObjectSortedMap<AtomicUpdateGroup<T>>) map;
//noinspection ConstantConditions
return singleMap.val.isFull();
});
}
);
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void testInvalidSpacesRegexLineTabulation()
{
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("thingToValidate cannot contain whitespace character except space.");
IdUtils.validateId(THINGO, "wtf\u000Bis line tabulation");
IdUtils.validateId(THINGO, "what\u000Bis line tabulation");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void start()
public void emit(Event event)
{
if (!started.get()) {
throw new ISE("WTF emit was called while service is not started yet");
throw new ISE("Emit called unexpectedly before service start");
}
if (event instanceof ServiceMetricEvent) {
final TimelineMetric timelineEvent = timelineMetricConverter.druidEventToTimelineMetric((ServiceMetricEvent) event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void start()
public void emit(Event event)
{
if (!started.get()) {
throw new ISE("WTF emit was called while service is not started yet");
throw new ISE("Emit called unexpectedly before service start");
}
if (event instanceof ServiceMetricEvent) {
final GraphiteEvent graphiteEvent = graphiteEventConverter.druidEventToGraphite((ServiceMetricEvent) event);
Expand Down Expand Up @@ -152,14 +152,14 @@ public ConsumerRunnable()
{
if (graphiteEmitterConfig.getProtocol().equals(GraphiteEmitterConfig.PLAINTEXT_PROTOCOL)) {
graphite = new Graphite(
graphiteEmitterConfig.getHostname(),
graphiteEmitterConfig.getPort()
graphiteEmitterConfig.getHostname(),
graphiteEmitterConfig.getPort()
);
} else {
graphite = new PickledGraphite(
graphiteEmitterConfig.getHostname(),
graphiteEmitterConfig.getPort(),
graphiteEmitterConfig.getBatchSize()
graphiteEmitterConfig.getHostname(),
graphiteEmitterConfig.getPort(),
graphiteEmitterConfig.getBatchSize()
);
}
log.info("Using %s protocol.", graphiteEmitterConfig.getProtocol());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void start()
public void emit(Event event)
{
if (!started.get()) {
throw new ISE("WTF emit was called while service is not started yet");
throw new ISE("Emit called unexpectedly before service start");
}
if (event instanceof ServiceMetricEvent) {
OpentsdbEvent opentsdbEvent = converter.convert((ServiceMetricEvent) event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public void handleAuthorizerUserUpdate(String authorizerPrefix, byte[] serialize
}
}
catch (Exception e) {
LOG.makeAlert(e, "WTF? Could not deserialize user/role map received from coordinator.").emit();
LOG.makeAlert(e, "Could not deserialize user/role map received from coordinator").emit();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void bufferAdd(ByteBuffer buf)
ByteBuffer other = selector.getObject();
if (other == null) {
// nulls should be empty bloom filters by this point, so encountering a nil column in merge agg is unexpected
throw new ISE("WTF?! Unexpected null value in BloomFilterMergeAggregator");
throw new ISE("Unexpected null value in BloomFilterMergeAggregator");
}
BloomKFilter.mergeBloomFilterByteBuffers(buf, buf.position(), other, other.position());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private BloomFilterMergeAggregator makeMergeAggregator(ColumnSelectorFactory met
final BaseNullableColumnValueSelector selector = metricFactory.makeColumnValueSelector(fieldName);
// null columns should be empty bloom filters by this point, so encountering a nil column in merge agg is unexpected
if (selector instanceof NilColumnValueSelector) {
throw new ISE("WTF?! Unexpected NilColumnValueSelector");
throw new ISE("Unexpected NilColumnValueSelector");
}
return new BloomFilterMergeAggregator((ColumnValueSelector<ByteBuffer>) selector, getMaxNumEntries(), true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2595,10 +2595,10 @@ public void testCheckpointForUnknownTaskGroup()
}

Assert.assertTrue(
serviceEmitter.getStackTrace().startsWith("org.apache.druid.java.util.common.ISE: WTH?! cannot find")
serviceEmitter.getStackTrace().startsWith("org.apache.druid.java.util.common.ISE: Cannot find")
);
Assert.assertEquals(
"WTH?! cannot find taskGroup [0] among all activelyReadingTaskGroups [{}]",
"Cannot find taskGroup [0] among all activelyReadingTaskGroups [{}]",
serviceEmitter.getExceptionMessage()
);
Assert.assertEquals(ISE.class, serviceEmitter.getExceptionClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3195,9 +3195,9 @@ public void testCheckpointForUnknownTaskGroup()
}

Assert.assertTrue(serviceEmitter.getStackTrace()
.startsWith("org.apache.druid.java.util.common.ISE: WTH?! cannot find"));
.startsWith("org.apache.druid.java.util.common.ISE: Cannot find"));
Assert.assertEquals(
"WTH?! cannot find taskGroup [0] among all activelyReadingTaskGroups [{}]",
"Cannot find taskGroup [0] among all activelyReadingTaskGroups [{}]",
serviceEmitter.getExceptionMessage()
);
Assert.assertEquals(ISE.class, serviceEmitter.getExceptionClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public String apply(@Nullable String key)
}
final CacheRefKeeper cacheRefKeeper = refOfCacheKeeper.get();
if (cacheRefKeeper == null) {
throw new ISE("Cache reference is null WTF");
throw new ISE("Cache reference is null");
}
final PollingCache cache = cacheRefKeeper.getAndIncrementRef();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ public Map<String, Object> getStats()

Map<String, Object> metrics = TaskMetricsUtils.makeIngestionRowMetrics(
jobCounters.findCounter(HadoopDruidIndexerConfig.IndexJobCounters.ROWS_PROCESSED_COUNTER).getValue(),
jobCounters.findCounter(HadoopDruidIndexerConfig.IndexJobCounters.ROWS_PROCESSED_WITH_ERRORS_COUNTER).getValue(),
jobCounters.findCounter(HadoopDruidIndexerConfig.IndexJobCounters.ROWS_PROCESSED_WITH_ERRORS_COUNTER)
.getValue(),
jobCounters.findCounter(HadoopDruidIndexerConfig.IndexJobCounters.ROWS_UNPARSEABLE_COUNTER).getValue(),
jobCounters.findCounter(HadoopDruidIndexerConfig.IndexJobCounters.ROWS_THROWN_AWAY_COUNTER).getValue()
);
Expand Down Expand Up @@ -318,7 +319,7 @@ protected void innerMap(
.bucketInterval(DateTimes.utc(inputRow.getTimestampFromEpoch()));

if (!maybeInterval.isPresent()) {
throw new ISE("WTF?! No bucket found for timestamp: %s", inputRow.getTimestampFromEpoch());
throw new ISE("No bucket found for timestamp: %s", inputRow.getTimestampFromEpoch());
}
interval = maybeInterval.get();
}
Expand Down Expand Up @@ -387,7 +388,7 @@ protected void reduce(
Optional<Interval> intervalOptional = config.getGranularitySpec().bucketInterval(DateTimes.utc(key.get()));

if (!intervalOptional.isPresent()) {
throw new ISE("WTF?! No bucket found for timestamp: %s", key.get());
throw new ISE("No bucket found for timestamp: %s", key.get());
}
interval = intervalOptional.get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void emitDimValueCounts(
final Optional<Interval> maybeInterval = config.getGranularitySpec().bucketInterval(timestamp);

if (!maybeInterval.isPresent()) {
throw new ISE("WTF?! No bucket found for timestamp: %s", timestamp);
throw new ISE("No bucket found for timestamp: %s", timestamp);
}

final Interval interval = maybeInterval.get();
Expand Down Expand Up @@ -627,7 +627,7 @@ protected void innerReduce(Context context, SortableBytes keyBytes, Iterable<Dim
final long totalRows = firstDvc.numRows;

if (!"".equals(firstDvc.dim) || !"".equals(firstDvc.value)) {
throw new IllegalStateException("WTF?! Expected total row indicator on first k/v pair!");
throw new IllegalStateException("Expected total row indicator on first k/v pair");
}

// "iterator" will now take us over many candidate dimensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ protected void innerMap(
final Optional<Bucket> bucket = getConfig().getBucket(inputRow);

if (!bucket.isPresent()) {
throw new ISE("WTF?! No bucket found for row: %s", inputRow);
throw new ISE("No bucket found for row: %s", inputRow);
}

final long truncatedTimestamp = granularitySpec.getQueryGranularity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import org.apache.druid.query.NoopQueryRunner;
import org.apache.druid.query.Query;
import org.apache.druid.query.QueryRunner;
import org.apache.druid.segment.SegmentUtils;
import org.apache.druid.segment.indexing.DataSchema;
import org.apache.druid.segment.indexing.RealtimeIOConfig;
import org.apache.druid.segment.realtime.FireDepartment;
Expand Down Expand Up @@ -338,7 +339,10 @@ public TaskStatus run(final TaskToolbox toolbox)

final TransactionalSegmentPublisher publisher = (mustBeNullOrEmptySegments, segments, commitMetadata) -> {
if (mustBeNullOrEmptySegments != null && !mustBeNullOrEmptySegments.isEmpty()) {
throw new ISE("WTH? stream ingestion tasks are overwriting segments[%s]", mustBeNullOrEmptySegments);
throw new ISE(
"Stream ingestion task unexpectedly attempted to overwrite segments: %s",
SegmentUtils.commaSeparatedIdentifiers(mustBeNullOrEmptySegments)
);
}
final SegmentTransactionalInsertAction action = SegmentTransactionalInsertAction.appendAction(
segments,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public TaskStatus run(TaskToolbox toolbox) throws Exception
for (final DataSegment unusedSegment : unusedSegments) {
if (unusedSegment.getVersion().compareTo(myLock.getVersion()) > 0) {
throw new ISE(
"WTF?! Unused segment[%s] has version[%s] > task version[%s]",
"Unused segment[%s] has version[%s] > task version[%s]",
unusedSegment.getId(),
unusedSegment.getVersion(),
myLock.getVersion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public TaskStatus run(TaskToolbox toolbox) throws Exception
for (final DataSegment unusedSegment : unusedSegments) {
if (unusedSegment.getVersion().compareTo(myLock.getVersion()) > 0) {
throw new ISE(
"WTF?! Unused segment[%s] has version[%s] > task version[%s]",
"Unused segment[%s] has version[%s] > task version[%s]",
unusedSegment.getId(),
unusedSegment.getVersion(),
myLock.getVersion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public TaskStatus run(final TaskToolbox toolbox) throws Exception
runThread = Thread.currentThread();

if (this.plumber != null) {
throw new IllegalStateException("WTF?!? run with non-null plumber??!");
throw new IllegalStateException("Plumber must be null");
}

setupTimeoutAlert();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public TaskStatus run(TaskToolbox toolbox) throws Exception
for (final DataSegment unusedSegment : unusedSegments) {
if (unusedSegment.getVersion().compareTo(myLock.getVersion()) > 0) {
throw new ISE(
"WTF?! Unused segment[%s] has version[%s] > task version[%s]",
"Unused segment[%s] has version[%s] > task version[%s]",
unusedSegment.getId(),
unusedSegment.getVersion(),
myLock.getVersion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public TaskStatus runTask(TaskToolbox toolbox) throws Exception
final String mustBeNull = intervalToVersion.put(lock.getInterval(), lock.getVersion());
if (mustBeNull != null) {
throw new ISE(
"WTH? Two versions([%s], [%s]) for the same interval[%s]?",
"Unexpected state: Two versions([%s], [%s]) for the same interval[%s]",
lock.getVersion(),
mustBeNull,
lock.getInterval()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public List<Pair<Task, ListenableFuture<TaskStatus>>> restore()
final Task task = jsonMapper.readValue(taskFile, Task.class);

if (!task.getId().equals(taskId)) {
throw new ISE("WTF?! Task[%s] restore file had wrong id[%s].", taskId, task.getId());
throw new ISE("Task[%s] restore file had wrong id[%s]", taskId, task.getId());
}

if (taskConfig.isRestoreTasksOnRestart() && task.canRestore()) {
Expand Down
Loading