Skip to content

Commit

Permalink
update readme, rename confusing class name
Browse files Browse the repository at this point in the history
  • Loading branch information
chpengzh committed May 1, 2018
1 parent 899c57f commit fa4dac6
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 22 deletions.
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -152,9 +152,13 @@ The main contents of that module are the EPGM data model and a corresponding POJ
implementation which is used in Flink™. The persistent representation of the EPGM
is also contained in gradoop-common and together with its mapping to HBase™.

### gradoop-accumulo

Input and output formats for reading and writing graph collections from [Apache Accumulo](https://accumulo.apache.org/).

### gradoop-hbase

Input and output formats for reading and writing graph collections from Apache HBase.
Input and output formats for reading and writing graph collections from [Apache HBase](https://hbase.apache.org/).

### gradoop-flink

Expand Down
Expand Up @@ -46,7 +46,7 @@
import org.gradoop.common.storage.api.EPGMStore;
import org.gradoop.common.storage.impl.accumulo.constants.AccumuloDefault;
import org.gradoop.common.storage.impl.accumulo.handler.AccumuloRowHandler;
import org.gradoop.common.storage.impl.accumulo.iterator.client.CacheClosableIteratorIterator;
import org.gradoop.common.storage.impl.accumulo.iterator.client.CacheClosableIterator;
import org.gradoop.common.storage.impl.accumulo.iterator.client.CloseableIterator;
import org.gradoop.common.storage.impl.accumulo.iterator.tserver.GradoopEdgeIterator;
import org.gradoop.common.storage.impl.accumulo.iterator.tserver.GradoopGraphHeadIterator;
Expand Down Expand Up @@ -211,7 +211,7 @@ public CloseableIterator<V> getVertexSpace() throws IOException {
public CloseableIterator<V> getVertexSpace(int cacheSize) throws IOException {
BatchScanner scanner = createBatchScanner(getVertexTableName(), GradoopVertexIterator.class);
scanner.setRanges(Lists.newArrayList(new Range((Text) null, null)));
return new CacheClosableIteratorIterator<>(scanner, new GradoopVertexIterator(), config
return new CacheClosableIterator<>(scanner, new GradoopVertexIterator(), config
.getVertexHandler(), cacheSize);
}

Expand All @@ -224,7 +224,7 @@ public CloseableIterator<E> getEdgeSpace() throws IOException {
public CloseableIterator<E> getEdgeSpace(int cacheSize) throws IOException {
BatchScanner scanner = createBatchScanner(getEdgeTableName(), GradoopEdgeIterator.class);
scanner.setRanges(Lists.newArrayList(new Range((Text) null, null)));
return new CacheClosableIteratorIterator<>(scanner, new GradoopEdgeIterator(), config
return new CacheClosableIterator<>(scanner, new GradoopEdgeIterator(), config
.getEdgeHandler(), cacheSize);
}

Expand All @@ -237,7 +237,7 @@ public CloseableIterator<G> getGraphSpace() throws IOException {
public CloseableIterator<G> getGraphSpace(int cacheSize) throws IOException {
BatchScanner scanner = createBatchScanner(getGraphHeadName(), GradoopGraphHeadIterator.class);
scanner.setRanges(Lists.newArrayList(new Range((Text) null, null)));
return new CacheClosableIteratorIterator<>(scanner, new GradoopGraphHeadIterator(), config
return new CacheClosableIterator<>(scanner, new GradoopGraphHeadIterator(), config
.getGraphHandler(), cacheSize);
}

Expand Down
Expand Up @@ -31,12 +31,12 @@
import java.util.Map;

/**
* cache iterator for scanner result
* cache iterator for accumulo scanner's result
*
* @param <E> EPGM Element as reading result
* @param <R> ElementRow from iterator rpc result
*/
public class CacheClosableIteratorIterator<E extends EPGMElement, R extends ElementRow> implements
public class CacheClosableIterator<E extends EPGMElement, R extends ElementRow> implements
CloseableIterator<E> {

/**
Expand Down Expand Up @@ -76,7 +76,7 @@ public class CacheClosableIteratorIterator<E extends EPGMElement, R extends Elem
* @param handler result element row handler
* @param cacheSize result cache size
*/
public CacheClosableIteratorIterator(
public CacheClosableIterator(
BatchScanner scanner,
BaseElementIterator<R> codec,
AccumuloRowHandler<E, ?, R> handler,
Expand Down
Expand Up @@ -23,7 +23,7 @@
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.gradoop.common.storage.impl.accumulo.constants.AccumuloTables;
import org.gradoop.common.storage.impl.accumulo.row.EdgeRow;
import org.gradoop.common.utils.Json;
import org.gradoop.common.utils.JsonUtils;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand All @@ -42,7 +42,7 @@ public class GradoopEdgeIterator extends BaseElementIterator<EdgeRow> {
public EdgeRow fromRow(@Nonnull Map.Entry<Key, Value> pair) {
//TODO: use kryo instead of json for better performance
//map from serialize content
EdgeRow content = Json.loads(pair.getValue().get(), EdgeRow.class);
EdgeRow content = JsonUtils.loads(pair.getValue().get(), EdgeRow.class);
content.setId(pair.getKey().getRow().toString());
//read from content
return content;
Expand All @@ -52,7 +52,7 @@ public EdgeRow fromRow(@Nonnull Map.Entry<Key, Value> pair) {
@Override
public Pair<Key, Value> toRow(@Nonnull EdgeRow record) {
//write to content
return new Pair<>(new Key(record.getId()), new Value(Json.dumps(record)));
return new Pair<>(new Key(record.getId()), new Value(JsonUtils.dumps(record)));
}

@Nonnull
Expand Down Expand Up @@ -125,7 +125,7 @@ private EdgeRow readLine(SortedKeyValueIterator<Key, Value> source) throws IOExc
source.next();
}

LOG.info(String.format("[edge]readLine=>%s", Json.dumps(row)));
LOG.info(String.format("[edge]readLine=>%s", JsonUtils.dumps(row)));
return row;
}
}
Expand Up @@ -23,7 +23,7 @@
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.gradoop.common.storage.impl.accumulo.constants.AccumuloTables;
import org.gradoop.common.storage.impl.accumulo.row.GraphHeadRow;
import org.gradoop.common.utils.Json;
import org.gradoop.common.utils.JsonUtils;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand All @@ -42,7 +42,7 @@ public class GradoopGraphHeadIterator extends BaseElementIterator<GraphHeadRow>
public GraphHeadRow fromRow(@Nonnull Map.Entry<Key, Value> pair) {
//TODO: use kryo instead of json for better performance
//map from serialize content
GraphHeadRow content = Json.loads(pair.getValue().get(), GraphHeadRow.class);
GraphHeadRow content = JsonUtils.loads(pair.getValue().get(), GraphHeadRow.class);
content.setId(pair.getKey().getRow().toString());
//read from content
return content;
Expand All @@ -52,7 +52,7 @@ public GraphHeadRow fromRow(@Nonnull Map.Entry<Key, Value> pair) {
@Override
public Pair<Key, Value> toRow(@Nonnull GraphHeadRow record) {
//write to content
return new Pair<>(new Key(record.getId()), new Value(Json.dumps(record)));
return new Pair<>(new Key(record.getId()), new Value(JsonUtils.dumps(record)));
}

@Nonnull
Expand Down Expand Up @@ -116,7 +116,7 @@ private GraphHeadRow readLine(SortedKeyValueIterator<Key, Value> source) throws
source.next();
}

LOG.info(String.format("[graph]readLine=>%s", Json.dumps(row)));
LOG.info(String.format("[graph]readLine=>%s", JsonUtils.dumps(row)));
return row;
}
}
Expand Up @@ -23,7 +23,7 @@
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.gradoop.common.storage.impl.accumulo.constants.AccumuloTables;
import org.gradoop.common.storage.impl.accumulo.row.VertexRow;
import org.gradoop.common.utils.Json;
import org.gradoop.common.utils.JsonUtils;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand All @@ -42,7 +42,7 @@ public class GradoopVertexIterator extends BaseElementIterator<VertexRow> {
public VertexRow fromRow(@Nonnull Map.Entry<Key, Value> pair) {
//TODO: use kryo instead of json for better performance
//map from serialize content
VertexRow content = Json.loads(pair.getValue().get(), VertexRow.class);
VertexRow content = JsonUtils.loads(pair.getValue().get(), VertexRow.class);
content.setId(pair.getKey().getRow().toString());
//read from content
return content;
Expand All @@ -52,7 +52,7 @@ public VertexRow fromRow(@Nonnull Map.Entry<Key, Value> pair) {
@Override
public Pair<Key, Value> toRow(@Nonnull VertexRow record) {
//write to content
return new Pair<>(new Key(record.getId()), new Value(Json.dumps(record)));
return new Pair<>(new Key(record.getId()), new Value(JsonUtils.dumps(record)));
}

@Nonnull
Expand Down Expand Up @@ -119,7 +119,7 @@ private VertexRow readLine(SortedKeyValueIterator<Key, Value> source) throws IOE
source.next();
}

LOG.info(String.format("[vertex]readLine=>%s", Json.dumps(row)));
LOG.info(String.format("[vertex]readLine=>%s", JsonUtils.dumps(row)));
return row;
}

Expand Down
Expand Up @@ -25,7 +25,7 @@
/**
* json serialize utils
*/
public final class Json {
public final class JsonUtils {

/**
* normal mapper
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -109,7 +109,7 @@
<license.licenseName>apache_v2</license.licenseName>

<!-- alpha order require -->
<dep.accumulo.version>1.8.1</dep.accumulo.version>
<dep.accumulo.version>1.9.0</dep.accumulo.version>
<dep.bson.version>3.6.3</dep.bson.version>
<dep.flink.version>1.3.1</dep.flink.version>
<dep.gdl.version>0.3</dep.gdl.version>
Expand Down

0 comments on commit fa4dac6

Please sign in to comment.