public final class SegmentGraph extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SegmentGraph.Graph<T>
A simple graph representation for a graph with node of type
T. |
static interface |
SegmentGraph.SegmentGraphVisitor
Visitor for receiving call backs while traversing the
segment graph.
|
| Modifier and Type | Method and Description |
|---|---|
static com.google.common.base.Predicate<UUID> |
createRegExpFilter(String pattern,
SegmentTracker tracker)
Create a regular expression based inclusion filter for segment.
|
static SegmentGraph.Graph<String> |
parseGCGraph(FileStore.ReadOnlyStore fileStore)
Parse the gc generation graph of a file store.
|
static SegmentGraph.Graph<UUID> |
parseHeadGraph(RecordId root)
Parser the head graph.
|
static SegmentGraph.Graph<UUID> |
parseSegmentGraph(FileStore.ReadOnlyStore fileStore,
com.google.common.base.Predicate<UUID> filter)
Parse the segment graph of a file store.
|
static <T> SegmentGraph.Graph<T> |
parseSegmentGraph(FileStore.ReadOnlyStore fileStore,
Set<UUID> roots,
com.google.common.base.Predicate<UUID> filter,
com.google.common.base.Function<UUID,T> map)
Parse the segment graph of a file store starting with a given set of root segments.
|
static void |
writeGCGraph(FileStore.ReadOnlyStore fileStore,
OutputStream out)
Write the gc generation graph of a file store to a stream.
|
static void |
writeSegmentGraph(FileStore.ReadOnlyStore fileStore,
OutputStream out,
Date epoch,
String pattern)
Write the segment graph of a file store to a stream.
|
public static void writeSegmentGraph(@Nonnull FileStore.ReadOnlyStore fileStore, @Nonnull OutputStream out, @Nonnull Date epoch, @CheckForNull String pattern) throws Exception
The graph is written in
the Guess GDF format,
which is easily imported into Gephi.
As GDF only supports integers but the segment time stamps are encoded as long
the epoch argument is used as a negative offset translating all timestamps
into a valid int range.
fileStore - file store to graphout - stream to write the graph toepoch - epoch (in milliseconds)pattern - regular expression specifying inclusion of nodes or null
for all nodes.Exceptionpublic static com.google.common.base.Predicate<UUID> createRegExpFilter(@Nonnull String pattern, @Nonnull SegmentTracker tracker)
pattern - regular expression specifying inclusion of nodes.tracker - the segment tracker of the store acting upon.@Nonnull public static SegmentGraph.Graph<UUID> parseSegmentGraph(@Nonnull FileStore.ReadOnlyStore fileStore, @Nonnull com.google.common.base.Predicate<UUID> filter) throws IOException
fileStore - file store to parsefilter - inclusion criteria for vertices and edges. An edge is only included if
both its source and target vertex are included.fileStore.IOExceptionpublic static void writeGCGraph(@Nonnull FileStore.ReadOnlyStore fileStore, @Nonnull OutputStream out) throws Exception
The graph is written in the Guess GDF format, which is easily imported into Gephi.
fileStore - file store to graphout - stream to write the graph toException@Nonnull public static SegmentGraph.Graph<String> parseGCGraph(@Nonnull FileStore.ReadOnlyStore fileStore) throws IOException
fileStore - file store to parsefileStore.IOException@Nonnull public static <T> SegmentGraph.Graph<T> parseSegmentGraph(@Nonnull FileStore.ReadOnlyStore fileStore, @Nonnull Set<UUID> roots, @Nonnull com.google.common.base.Predicate<UUID> filter, @Nonnull com.google.common.base.Function<UUID,T> map) throws IOException
map to the
graph returned by this function.fileStore - file store to parseroots - the initial set of segmentsmap - map defining an homomorphism from the segment graph into the returned graphfilter - inclusion criteria for vertices and edges. An edge is only included if
both its source and target vertex are included.fileStore rooted at roots and mapped
by mapIOException@Nonnull public static SegmentGraph.Graph<UUID> parseHeadGraph(@Nonnull RecordId root)
root.root - root.Copyright © 2012-2018 The Apache Software Foundation. All Rights Reserved.