leventov commented on a change in pull request #6370: Introduce SegmentId class
URL: https://github.com/apache/incubator-druid/pull/6370#discussion_r221700643
##########
File path: api/src/main/java/org/apache/druid/timeline/DataSegment.java
##########
@@ -50,41 +50,20 @@
import java.util.stream.Collectors;
/**
+ * Metadata of Druid's data segment. An immutable object.
+ *
+ * DataSegment's equality ({@link #equals}/{@link #hashCode}) and {@link
#compareTo} methods consider only the
+ * {@link SegmentId} of the segment.
*/
@PublicApi
public class DataSegment implements Comparable<DataSegment>
{
- public static String delimiter = "_";
- private final Integer binaryVersion;
- private static final Interner<String> STRING_INTERNER =
Interners.newWeakInterner();
- private static final Interner<List<String>> DIMENSIONS_INTERNER =
Interners.newWeakInterner();
- private static final Interner<List<String>> METRICS_INTERNER =
Interners.newWeakInterner();
- private static final Map<String, Object> PRUNED_LOAD_SPEC = ImmutableMap.of(
- "load spec is pruned, because it's not needed on Brokers, but eats a lot
of heap space",
- ""
- );
-
- public static String makeDataSegmentIdentifier(
- String dataSource,
- DateTime start,
- DateTime end,
- String version,
- ShardSpec shardSpec
- )
- {
- StringBuilder sb = new StringBuilder();
-
- sb.append(dataSource).append(delimiter)
- .append(start).append(delimiter)
- .append(end).append(delimiter)
- .append(version);
-
- if (shardSpec.getPartitionNum() != 0) {
- sb.append(delimiter).append(shardSpec.getPartitionNum());
- }
-
- return sb.toString();
- }
+ /*
+ * The difference between this class and org.apache.druid.segment.Segment is
that this class contains the segment
+ * metadata only, while org.apache.druid.segment.Segment represents the
actual body of segment data, queryable.
+ *
+ * TODO explain the difference with org.apache.druid.query.SegmentDescriptor
Review comment:
We do usually have a policy that we create issues on Github instead of TODOs
in code, but I felt this is a too small thing for this. We should probably
allow TODOs for documentation only (including internal, Javadoc documentation).
I'll create a thread about this in the dev mailing list.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]