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 @@ -27,6 +27,7 @@
import org.apache.druid.timeline.DataSegment;

import java.util.Set;
import java.util.stream.Collectors;

/**
* Insert segments into metadata storage. The segment versions must all be less than or equal to a lock held by
Expand Down Expand Up @@ -83,7 +84,7 @@ public boolean isAudited()
public String toString()
{
return "SegmentInsertAction{" +
"segments=" + segments +
"segments=" + segments.stream().map(DataSegment::getIdentifier).collect(Collectors.joining(",")) +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public boolean isAudited()
public String toString()
{
return "SegmentMetadataUpdateAction{" +
"segments=" + segments +
"segments=" + segments.stream().map(DataSegment::getIdentifier).collect(Collectors.joining(",")) +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public boolean isAudited()
public String toString()
{
return "SegmentNukeAction{" +
"segments=" + segments +
"segments=" + segments.stream().map(DataSegment::getIdentifier).collect(Collectors.joining(",")) +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public boolean isAudited()
public String toString()
{
return "SegmentInsertAction{" +
"segments=" + segments +
"segments=" + segments.stream().map(DataSegment::getIdentifier).collect(Collectors.joining(",")) +
", startMetadata=" + startMetadata +
", endMetadata=" + endMetadata +
'}';
Expand Down
12 changes: 10 additions & 2 deletions processing/src/main/java/org/apache/druid/segment/IndexMerger.java
Original file line number Diff line number Diff line change
Expand Up @@ -397,19 +397,23 @@ class DictionaryMergeIterator implements CloseableIterator<String>
{
pQueue = new PriorityQueue<>(dimValueLookups.length, NULLS_FIRST_PEEKING_COMPARATOR);
conversions = new IntBuffer[dimValueLookups.length];

long mergeBufferTotalSize = 0;
for (int i = 0; i < conversions.length; i++) {
if (dimValueLookups[i] == null) {
continue;
}
Indexed<String> indexed = dimValueLookups[i];
if (useDirect) {
int allocationSize = indexed.size() * Integer.BYTES;
log.info("Allocating dictionary merging direct buffer with size[%,d]", allocationSize);
log.debug("Allocating dictionary merging direct buffer with size[%,d]", allocationSize);
mergeBufferTotalSize += allocationSize;
final ByteBuffer conversionDirectBuffer = ByteBuffer.allocateDirect(allocationSize);
conversions[i] = conversionDirectBuffer.asIntBuffer();
directBufferAllocations.add(new Pair<>(conversionDirectBuffer, allocationSize));
} else {
conversions[i] = IntBuffer.allocate(indexed.size());
mergeBufferTotalSize += indexed.size();
}

final PeekingIterator<String> iter = Iterators.peekingIterator(
Expand All @@ -422,6 +426,7 @@ class DictionaryMergeIterator implements CloseableIterator<String>
pQueue.add(Pair.of(i, iter));
}
}
log.info("Allocated [%,d] bytes of dictionary merging direct buffers", mergeBufferTotalSize);
}

@Override
Expand Down Expand Up @@ -482,10 +487,13 @@ public void remove()
@Override
public void close()
{
long mergeBufferTotalSize = 0;
for (Pair<ByteBuffer, Integer> bufferAllocation : directBufferAllocations) {
log.info("Freeing dictionary merging direct buffer with size[%,d]", bufferAllocation.rhs);
log.debug("Freeing dictionary merging direct buffer with size[%,d]", bufferAllocation.rhs);
mergeBufferTotalSize += bufferAllocation.rhs;
ByteBufferUtils.free(bufferAllocation.lhs);
}
log.info("Freed [,%d] bytes of dictionary merging direct buffers", mergeBufferTotalSize);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, should be %,d

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ private void processSegmentChangeRequest()

if (!segmentsToDrop.isEmpty()) {
currentlyProcessing = segmentsToDrop.firstEntry().getValue();
log.info("Server[%s] dropping [%s]", basePath, currentlyProcessing.getSegmentIdentifier());
log.debug("Server[%s] dropping [%s]", basePath, currentlyProcessing.getSegmentIdentifier());
} else if (!segmentsToLoad.isEmpty()) {
currentlyProcessing = segmentsToLoad.firstEntry().getValue();
log.info("Server[%s] loading [%s]", basePath, currentlyProcessing.getSegmentIdentifier());
log.debug("Server[%s] loading [%s]", basePath, currentlyProcessing.getSegmentIdentifier());
} else {
return;
}
Expand Down Expand Up @@ -386,7 +386,7 @@ private void entryRemoved(String path)
);
return;
}
log.info(
log.debug(
"Server[%s] done processing %s of segment [%s]",
basePath,
currentlyProcessing.getType() == LOAD ? "load" : "drop",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public CoordinatorCompactionConfig getCompactionConfig()

public void removeSegment(DataSegment segment)
{
log.info("Removing Segment[%s]", segment);
log.info("Removing Segment[%s]", segment.getIdentifier());
metadataSegmentManager.removeSegment(segment.getDataSource(), segment.getIdentifier());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public void onSuccess(InputStream result)
handleResponseStatus(e.getRequest(), e.getStatus());
break;
case PENDING:
log.info("Request[%s] is still pending on server[%s].", e.getRequest(), serverId);
log.debug("Request[%s] is still pending on server[%s].", e.getRequest(), serverId);
break;
default:
scheduleNextRunImmediately = false;
Expand Down Expand Up @@ -521,7 +521,7 @@ public boolean hasTimedOut()

public void requestSucceeded()
{
log.info(
log.debug(
"Server[%s] Successfully processed segment[%s] request[%s].",
serverId,
segment.getIdentifier(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ private void balanceTier(
moveSegment(segmentToMoveHolder, destinationHolder.getServer(), params);
moved++;
} else {
log.info("Segment [%s] is 'optimally' placed.", segmentToMove.getIdentifier());
log.debug("Segment [%s] is 'optimally' placed.", segmentToMove.getIdentifier());
unmoved++;
}
} else {
log.info(
log.debug(
"No valid movement destinations for segment [%s].",
segmentToMove.getIdentifier()
);
Expand Down Expand Up @@ -207,7 +207,7 @@ protected void moveSegment(
if (!toPeon.getSegmentsToLoad().contains(segmentToMove) &&
(toServer.getSegment(segmentName) == null) &&
new ServerHolder(toServer, toPeon).getAvailableSize() > segmentToMove.getSize()) {
log.info("Moving [%s] from [%s] to [%s]", segmentName, fromServer.getName(), toServer.getName());
log.debug("Moving [%s] from [%s] to [%s]", segmentName, fromServer.getName(), toServer.getName());

LoadPeonCallback callback = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ private CoordinatorStats doRun(
config.getTuningConfig(),
config.getTaskContext()
);
LOG.info("Submitted a compactTask[%s] for segments[%s]", taskId, segmentsToCompact);
LOG.info(
"Submitted a compactTask[%s] for segments[%s]",
taskId,
segmentsToCompact.stream().map(DataSegment::getIdentifier).collect(Collectors.joining(","))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This joiner thing looks like it would be a good utility function. Including a space after the comma would be a good idea, too, I think, since it visually spaces them out a bit more and would make the log line easier on the eyes.

);
} else if (segmentsToCompact.size() == 1) {
throw new ISE("Found one segments[%s] to compact", segmentsToCompact);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public void poll()
)
);

log.info("Got [%,d] rules", newRules.size());
log.debug("Got [%,d] rules", newRules.size());

rules.set(newRules);
}
Expand Down