Skip to content

Commit

Permalink
[release] release 0.4.1 (#957)
Browse files Browse the repository at this point in the history
### Release 0.4.1

* [#877] added support for property value null (#908)

fixes #877

* [#856] property pushdown hbase (#906)

fixes #856

* [#864] Change examples to use csv (#905)

fixes #864

* [#494] Add Set support to PropertyValue (#916)

fixes #494

* [#888] Minor changes to Tuple-related functions. (#912)

fixes #888

* [#779] Add code coverage for Gradoop (#914)

fixes #779

* [#702] Add support for graphs without edges to TLFDataSource (#921)

fixes #702

* [#909] Remove Flink dependency for store instance (#918)

fixes #909

* [#876] added print for logical graph and graph collection (#913)

fixes #876

* [#857] logical predicate chaining hbase (#920)

fixes #857

* [#926] added argLine to maven properties (fix ide testing bug) (#929)

fixes #926

* [#794] include new benchmark classes (#904)

fixes #794

* [#312] example program for aggregation (#925)

fixes #312

* [#901] Add SamplingConstants, AggregationConstants (#934)

fixed #901

* [#935] Add tests for containment functions (#941)

fixes #935

* [#900] Refactor sampling tests. (#907)

fixes #900

* [#936] Generalized RollUp and DrillDown (#939)

fixes #936

* [#947] Fix PageRank wrapper and add a test. (#949)

fixes #947

* [#942] graph density computation for sampling evaluation (#946)

fixes #942

* [#954] prepare minor release (#955)

fixes #954
  • Loading branch information
Kevin Gómez authored and ChrizZz110 committed Aug 24, 2018
1 parent 68efc3d commit c5b3a66
Show file tree
Hide file tree
Showing 242 changed files with 10,780 additions and 3,367 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)](https://www.apache.org/licenses/LICENSE-2.0)
[![Maven Central](https://img.shields.io/badge/Maven_Central-0.4.0-blue.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cgradoop)
[![Maven Central](https://img.shields.io/badge/Maven_Central-0.4.1-blue.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cgradoop)
[![Build Status](https://travis-ci.org/dbs-leipzig/gradoop.svg?branch=master)](https://travis-ci.org/dbs-leipzig/gradoop)

## Gradoop: Distributed Graph Analytics on Hadoop
Expand Down Expand Up @@ -108,7 +108,7 @@ Stable:
<dependency>
<groupId>org.gradoop</groupId>
<artifactId>gradoop-flink</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
</dependency>
```

Expand Down
44 changes: 25 additions & 19 deletions dev-support/store/hbase_table_layout
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
GraphData (table 'graph_heads')

----------*-------------*-------------------------*---------------*---------------------
----------*-------------*-------------------------*---------------*-----------------------
row | cf | cq | timestamp | value
----------*-------------*-------------------------*---------------*---------------------
----------*-------------*-------------------------*---------------*-----------------------
| m | l | | {label}
{id} *-------------*-------------------------*---------------*---------------------
| p | {property key} | | {property value}
----------*-------------*-------------------------*---------------*---------------------
{id} *-------------*-------------------------*---------------*-----------------------
| p_type | {property key} | | {property type byte}
*-------------*-------------------------*---------------*-----------------------
| p_value | {property key} | | {property value}
----------*-------------*-------------------------*---------------*-----------------------


VertexData (table 'vertices')

----------*-------------*-------------------------*---------------*---------------------
----------*-------------*-------------------------*---------------*-----------------------
row | cf | cq | timestamp | value
----------*-------------*-------------------------*---------------*---------------------
----------*-------------*-------------------------*---------------*-----------------------
| m | l | | {label}
{id} *-------------*-------------------------*---------------*---------------------
{id} *-------------*-------------------------*---------------*-----------------------
| m | g | | {graph id}
*-------------*-------------------------*---------------*---------------------
| p | {property key} | | {property value}
----------*-------------*-------------------------*---------------*---------------------
*-------------*-------------------------*---------------*-----------------------
| p_type | {property key} | | {property type byte}
*-------------*-------------------------*---------------*-----------------------
| p_value | {property key} | | {property value}
----------*-------------*-------------------------*---------------*-----------------------


EdgeData (table 'edges')

----------*-------------*-------------------------*---------------*---------------------
----------*-------------*-------------------------*---------------*-----------------------
row | cf | cq | timestamp | value
----------*-------------*-------------------------*---------------*---------------------
----------*-------------*-------------------------*---------------*-----------------------
| m | l | | {label}
*-------------*-------------------------*---------------*---------------------
*-------------*-------------------------*---------------*-----------------------
| m | g | | {graph id}
{id} *-------------*-------------------------*---------------*---------------------
{id} *-------------*-------------------------*---------------*-----------------------
| m | s | | {source vertex id}
*-------------*-------------------------*---------------*---------------------
*-------------*-------------------------*---------------*-----------------------
| m | t | | {varget vertex id}
*-------------*-------------------------*---------------*---------------------
| p | {property key} | | {property value}
----------*-------------*-------------------------*---------------*---------------------
*-------------*-------------------------*---------------*-----------------------
| p_type | {property key} | | {property type byte}
*-------------*-------------------------*---------------*-----------------------
| p_value | {property key} | | {property value}
----------*-------------*-------------------------*---------------*-----------------------
2 changes: 1 addition & 1 deletion gradoop-checkstyle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.gradoop</groupId>
<artifactId>gradoop-parent</artifactId>
<version>0.5.0-SNAPSHOT</version>
<version>0.4.1</version>
</parent>

<artifactId>gradoop-checkstyle</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion gradoop-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.gradoop</groupId>
<artifactId>gradoop-parent</artifactId>
<version>0.5.0-SNAPSHOT</version>
<version>0.4.1</version>
</parent>

<artifactId>gradoop-common</artifactId>
Expand Down Expand Up @@ -104,6 +104,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -257,13 +258,28 @@ public int hashCode() {
return properties != null ? properties.hashCode() : 0;
}

/**
* {@inheritDoc}
*/
@Override
public Iterator<Property> iterator() {
return properties.entrySet().stream()
.map(e -> Property.create(e.getKey(), e.getValue()))
.collect(Collectors.toList()).iterator();
return toList().iterator();
}

/**
* Returns a list of properties.
*
* @return List of properties
*/
public List<Property> toList() {
return properties.entrySet().stream()
.map(e -> Property.create(e.getKey(), e.getValue()))
.collect(Collectors.toList());
}

/**
* {@inheritDoc}
*/
@Override
public void write(DataOutputView outputView) throws IOException {
outputView.writeInt(properties.size());
Expand All @@ -274,6 +290,10 @@ public void write(DataOutputView outputView) throws IOException {
}
}


/**
* {@inheritDoc}
*/
@Override
public void read(DataInputView inputView) throws IOException {
int propertyCount = inputView.readInt();
Expand All @@ -290,10 +310,13 @@ public void read(DataInputView inputView) throws IOException {
}
}

/**
* {@inheritDoc}
*/
@Override
public String toString() {
return properties.entrySet().stream()
.map(e -> Property.create(e.getKey(), e.getValue()).toString())
return toList().stream()
.map(Property::toString)
.collect(Collectors.joining(","));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Collections;
import java.util.Set;

/**
* Represents a single property value in the EPGM.
Expand Down Expand Up @@ -115,6 +117,10 @@ public class PropertyValue implements Value, Serializable, Comparable<PropertyVa
* {@code <property-type>} for {@link java.lang.Short}
*/
public static final transient byte TYPE_SHORT = 0x0e;
/**
* {@code <property-type>} for {@link java.util.Set}
*/
public static final transient byte TYPE_SET = 0x0f;

/**
* Value offset in byte
Expand Down Expand Up @@ -317,6 +323,14 @@ public boolean isTime() {
public boolean isDateTime() {
return rawBytes[0] == TYPE_DATETIME;
}
/**
* True, if the wrapped value is of type {@code Set}.
*
* @return true, if {@code Set} value
*/
public boolean isSet() {
return rawBytes[0] == TYPE_SET;
}

/**
* True, if the wrapped value is a subtype of {@code Number}.
Expand Down Expand Up @@ -351,7 +365,8 @@ public Object getObject() {
isDate() ? getDate() :
isTime() ? getTime() :
isDateTime() ? getDateTime() :
null;
isSet() ? getSet() :
null;
}
/**
* Returns the wrapped value as {@code boolean}.
Expand Down Expand Up @@ -542,6 +557,36 @@ public LocalDateTime getDateTime() {
return DateTimeSerializer.deserializeDateTime(
Arrays.copyOfRange(rawBytes, OFFSET, DateTimeSerializer.SIZEOF_DATETIME + OFFSET));
}
/**
* Returns the wrapped Set as {@code Set<PropertyValue>}.
*
* @return {@code Set<PropertyValue>} value
*/
public Set<PropertyValue> getSet() {
PropertyValue entry;

Set<PropertyValue> set = new HashSet<>();

ByteArrayInputStream byteStream = new ByteArrayInputStream(rawBytes);
DataInputStream inputStream = new DataInputStream(byteStream);
DataInputView inputView = new DataInputViewStreamWrapper(inputStream);

try {
if (inputStream.skipBytes(OFFSET) != OFFSET) {
throw new RuntimeException("Malformed entry in PropertyValue Set");
}
while (inputStream.available() > 0) {
entry = new PropertyValue();
entry.read(inputView);

set.add(entry);
}
} catch (IOException e) {
throw new RuntimeException("Error reading PropertyValue");
}

return set;
}

//----------------------------------------------------------------------------
// Setter
Expand All @@ -551,7 +596,7 @@ public LocalDateTime getDateTime() {
* Sets the given value as internal value if it has a supported type.
*
* @param value value
* @throws UnsupportedTypeException
* @throws UnsupportedTypeException if the type of the Object is not supported
*/
public void setObject(Object value) {
if (value == null) {
Expand Down Expand Up @@ -584,6 +629,8 @@ public void setObject(Object value) {
setTime((LocalTime) value);
} else if (value instanceof LocalDateTime) {
setDateTime((LocalDateTime) value);
} else if (value instanceof Set) {
setSet((Set) value);
} else {
throw new UnsupportedTypeException(value.getClass());
}
Expand Down Expand Up @@ -770,6 +817,30 @@ public void setDateTime(LocalDateTime dateTime) {
Bytes.putBytes(rawBytes, OFFSET, valueBytes, 0, valueBytes.length);
}

/**
* Sets the wrapped value as {@code Set} value.
*
* @param set value
*/
public void setSet(Set<PropertyValue> set) {
int size = set.stream().mapToInt(PropertyValue::byteSize).sum() + OFFSET;

ByteArrayOutputStream byteStream = new ByteArrayOutputStream(size);
DataOutputStream outputStream = new DataOutputStream(byteStream);
DataOutputView outputView = new DataOutputViewStreamWrapper(outputStream);

try {
outputStream.write(TYPE_SET);
for (PropertyValue entry : set) {
entry.write(outputView);
}
} catch (IOException e) {
throw new RuntimeException("Error writing PropertyValue");
}

this.rawBytes = byteStream.toByteArray();
}

//----------------------------------------------------------------------------
// Util
//----------------------------------------------------------------------------
Expand Down Expand Up @@ -804,6 +875,7 @@ private static Map<Byte, Class> getTypeMap() {
map.put(TYPE_DATE, LocalDate.class);
map.put(TYPE_TIME, LocalTime.class);
map.put(TYPE_DATETIME, LocalDateTime.class);
map.put(TYPE_SET, Set.class);
return Collections.unmodifiableMap(map);
}

Expand Down Expand Up @@ -871,7 +943,9 @@ public int compareTo(PropertyValue o) {
result = this.getTime().compareTo(o.getTime());
} else if (this.isDateTime() && o.isDateTime()) {
result = this.getDateTime().compareTo(o.getDateTime());
} else if (this.isMap() || o.isMap() || this.isList() || o.isList()) {
} else if (this.isMap() || o.isMap() ||
this.isList() || o.isList() ||
this.isSet() || o.isSet()) {
throw new UnsupportedOperationException(String.format(
"Method compareTo() is not supported for %s, %s", this.getClass(), o.getClass()));
} else {
Expand Down Expand Up @@ -926,7 +1000,7 @@ public void write(DataOutputView outputView) throws IOException {
}
outputView.writeByte(type);
// Write length for types with a variable length.
if (isString() || isBigDecimal() || isMap() || isList()) {
if (isString() || isBigDecimal() || isMap() || isList() || isSet()) {
// Write length as an int if the "large" flag is set.
if ((type & FLAG_LARGE) == FLAG_LARGE) {
outputView.writeInt(rawBytes.length - OFFSET);
Expand All @@ -946,7 +1020,8 @@ public void read(DataInputView inputView) throws IOException {
// Apply bitmask to get the actual type.
byte type = (byte) (~FLAG_LARGE & typeByte);
// dynamic type?
if (type == TYPE_STRING || type == TYPE_BIG_DECIMAL || type == TYPE_MAP || type == TYPE_LIST) {
if (type == TYPE_STRING || type == TYPE_BIG_DECIMAL || type == TYPE_MAP ||
type == TYPE_LIST || type == TYPE_SET) {
// read length
if ((typeByte & FLAG_LARGE) == FLAG_LARGE) {
length = inputView.readInt();
Expand Down
Loading

0 comments on commit c5b3a66

Please sign in to comment.