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
3 changes: 1 addition & 2 deletions docs/content/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ In current Druid, multiple data segments may be announced under the same Znode.
|--------|-----------|-------|
|`druid.announcer.segmentsPerNode`|Each Znode contains info for up to this many segments.|50|
|`druid.announcer.maxBytesPerNode`|Max byte size for Znode.|524288|
|`druid.announcer.skipDimensions`|Skip Dimension list from segment announcements. NOTE: Enabling this will also remove the dimensions list from coordinator and broker endpoints.|false|
|`druid.announcer.skipMetrics`|Skip Metrics list from segment announcements. NOTE: Enabling this will also remove the metrics list from coordinator and broker endpoints.|false|
|`druid.announcer.skipDimensionsAndMetrics`|Skip Dimensions and Metrics list from segment announcements. NOTE: Enabling this will also remove the dimensions and metrics list from coordinator and broker endpoints.|false|
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.

do we still have this info available via segment metadata query?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@fjy this PR is not changing anything, #2784 is the one that made the changes, and you +1 that one.

|`druid.announcer.skipLoadSpec`|Skip segment LoadSpec from segment announcements. NOTE: Enabling this will also remove the loadspec from coordinator and broker endpoints.|false|

Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,8 @@ public BatchDataSegmentAnnouncer(
public DataSegment apply(DataSegment input)
{
DataSegment rv = input;
if (config.isSkipDimensions()) {
rv = rv.withDimensions(null);
}
if (config.isSkipMetrics()) {
rv = rv.withMetrics(null);
if (config.isSkipDimensionsAndMetrics()) {
rv = rv.withDimensions(null).withMetrics(null);
}
if (config.isSkipLoadSpec()) {
rv = rv.withLoadSpec(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ public class BatchDataSegmentAnnouncerConfig

// Skip dimension list from segment announcements
@JsonProperty
private boolean skipDimensions = false;

// Skip metrics list from segment announcements
@JsonProperty
private boolean skipMetrics = false;
private boolean skipDimensionsAndMetrics = false;

public int getSegmentsPerNode()
{
Expand All @@ -64,13 +60,9 @@ public boolean isSkipLoadSpec()
return skipLoadSpec;
}

public boolean isSkipDimensions()
public boolean isSkipDimensionsAndMetrics()
{
return skipDimensions;
return skipDimensionsAndMetrics;
}

public boolean isSkipMetrics()
{
return skipMetrics;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ public class BatchDataSegmentAnnouncerTest
private Set<DataSegment> testSegments;

private final AtomicInteger maxBytesPerNode = new AtomicInteger(512 * 1024);
private Boolean skipDimensions;
private Boolean skipMetrics;
private Boolean skipDimensionsAndMetrics;
private Boolean skipLoadSpec;


Expand Down Expand Up @@ -98,8 +97,7 @@ public void setUp() throws Exception
announcer.start();

segmentReader = new SegmentReader(cf, jsonMapper);
skipDimensions = false;
skipMetrics = false;
skipDimensionsAndMetrics = false;
skipLoadSpec = false;
segmentAnnouncer = new BatchDataSegmentAnnouncer(
new DruidServerMetadata(
Expand All @@ -125,15 +123,9 @@ public long getMaxBytesPerNode()
}

@Override
public boolean isSkipDimensions()
public boolean isSkipDimensionsAndMetrics()
{
return skipDimensions;
}

@Override
public boolean isSkipMetrics()
{
return skipMetrics;
return skipDimensionsAndMetrics;
}

@Override
Expand Down Expand Up @@ -208,7 +200,7 @@ public void testSingleAnnounce() throws Exception
@Test
public void testSkipDimensions() throws Exception
{
skipDimensions = true;
skipDimensionsAndMetrics = true;
Iterator<DataSegment> segIter = testSegments.iterator();
DataSegment firstSegment = segIter.next();

Expand All @@ -220,27 +212,6 @@ public void testSkipDimensions() throws Exception
DataSegment announcedSegment = Iterables.getOnlyElement(segmentReader.read(joiner.join(testSegmentsPath, zNode)));
Assert.assertEquals(announcedSegment, firstSegment);
Assert.assertTrue(announcedSegment.getDimensions().isEmpty());
}

segmentAnnouncer.unannounceSegment(firstSegment);

Assert.assertTrue(cf.getChildren().forPath(testSegmentsPath).isEmpty());
}

@Test
public void testSkipMetrics() throws Exception
{
skipMetrics = true;
Iterator<DataSegment> segIter = testSegments.iterator();
DataSegment firstSegment = segIter.next();

segmentAnnouncer.announceSegment(firstSegment);

List<String> zNodes = cf.getChildren().forPath(testSegmentsPath);

for (String zNode : zNodes) {
DataSegment announcedSegment = Iterables.getOnlyElement(segmentReader.read(joiner.join(testSegmentsPath, zNode)));
Assert.assertEquals(announcedSegment, firstSegment);
Assert.assertTrue(announcedSegment.getMetrics().isEmpty());
}

Expand Down