-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconcile terminology and method naming to 'used/unused segments'; Rename MetadataSegmentManager to MetadataSegmentsManager #7306
Changes from all commits
87556bc
e44e199
25de70d
fe13d9c
050bd3b
562f5b4
a6138da
cb6fe7f
164f783
d959bb0
01c4494
06ec389
09fab95
f4774e1
8d5200d
255f320
f34eef0
2ebb23c
ba8ed62
64b0404
231a529
a113231
abad3f3
cb1f3b0
a5840b8
f4283d2
559f2c8
93c12cd
dfc0dbb
553b804
886e580
77fc5e8
1258fa0
15cb9ae
c2c7547
9cd239e
a723553
26a8381
afcd301
1557acc
96bcab7
d934853
c3e488e
f65e654
5e8f3e4
697f0d5
66a23f9
d3882c4
4b9d992
b77a327
d355aa6
718bb23
19b7f3a
2a6bcff
22e71d1
c575e6e
c5d22a0
285ebc9
53f572a
da7667c
91a5c8c
a566b6d
6da0b9d
d0bf20a
10587c1
2ad6dd5
6745f4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
|
||
package org.apache.druid.segment; | ||
|
||
import com.google.common.collect.Collections2; | ||
import com.google.common.hash.HashFunction; | ||
import com.google.common.hash.Hasher; | ||
import com.google.common.hash.Hashing; | ||
|
@@ -37,7 +38,6 @@ | |
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* Utility methods useful for implementing deep storage extensions. | ||
|
@@ -78,16 +78,14 @@ public static int getVersionFromDir(File inDir) throws IOException | |
} | ||
|
||
/** | ||
* Returns a String with identifiers of "segments" comma-separated. Useful for log messages. Not useful for anything | ||
* else, because this doesn't take special effort to escape commas that occur in identifiers (not common, but could | ||
* potentially occur in a datasource name). | ||
* Returns an object whose toString() returns a String with identifiers of the given segments, comma-separated. Useful | ||
* for log messages. Not useful for anything else, because this doesn't take special effort to escape commas that | ||
* occur in identifiers (not common, but could potentially occur in a datasource name). | ||
*/ | ||
public static String commaSeparateIdentifiers(final Collection<DataSegment> segments) | ||
public static Object commaSeparatedIdentifiers(final Collection<DataSegment> segments) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, the method name doesn't look valid anymore. Maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The purpose is to make this method unusable for anything except logging. To obtain a collection of SegmentIds, people should usually use Stream API to create a non-lazy collection. |
||
{ | ||
return segments | ||
.stream() | ||
.map(segment -> segment.getId().toString()) | ||
.collect(Collectors.joining(", ")); | ||
// Lazy, to avoid preliminary string creation if logging level is turned off | ||
return Collections2.transform(segments, DataSegment::getId); | ||
} | ||
|
||
private SegmentUtils() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you add a javadoc saying when it can be null? Perhaps it would be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for suggestion, applied