Skip to content

Commit 01eb404

Browse files
committed
Reworked serialization api
1 parent 03edf19 commit 01eb404

27 files changed

+2282
-3447
lines changed

.classpath

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
<classpathentry kind="lib" path="libs/slf4j-api-1.7.10.jar"/>
1919
<classpathentry kind="lib" path="libs/trove-3.1a1.jar" sourcepath="/Users/cogmission/Resources/trove/3.1a1/trove-3.1a1-src.jar"/>
2020
<classpathentry kind="lib" path="libs/java-util-1.19.3.jar" sourcepath="/Users/cogmission/.m2/repository/com/cedarsoftware/java-util/1.19.3/java-util-1.19.3-sources.jar"/>
21-
<classpathentry kind="lib" path="libs/kryo-shaded-3.0.3.jar" sourcepath="/Users/cogmission/.m2/repository/com/esotericsoftware/kryo-shaded/3.0.3/kryo-shaded-3.0.3-sources.jar"/>
22-
<classpathentry kind="lib" path="libs/kryo-serializers-0.37.jar" sourcepath="/Users/cogmission/.m2/repository/de/javakaffee/kryo-serializers/0.37/kryo-serializers-0.37-sources.jar"/>
2321
<classpathentry kind="lib" path="libs/objenesis-2.1.jar"/>
24-
<classpathentry kind="lib" path="libs/minlog-1.3-SNAPHOT.jar"/>
2522
<classpathentry combineaccessrules="false" kind="src" path="/fast-serialization"/>
2623
<classpathentry kind="output" path="bin"/>
2724
</classpath>

Changelog.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ Changes for Serialization branch (notes for CHANGELOG.md)
1919
11. Added NetworkSerializer interface (and NetworkSerializerImpl) which executes FST serialization
2020
and simultaneously implements the Kryo interface also.
2121
12. Added the SerialConfig class which contains config information for the NetworkSerializer.
22-
13. Added Network.Scheme enum which has two values { FST, KRYO }, to designate underlying
23-
serialization scheme (Kryo still delegates to FST but implements Kryo Serializer interface)

build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ dependencies {
4949
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.10'
5050
compile group: 'io.reactivex', name: 'rxjava', version: '1.0.10'
5151
compile group: 'de.ruedigermoeller', name: 'fst', version: '2.45'
52-
compile group: 'com.esotericsoftware', name: 'kryo-shaded', version: '3.0.3'
53-
compile group: 'com.esotericsoftware', name: 'minlog', version: '1.3-SNAPSHOT'
54-
compile group: 'de.javakaffee', name: 'kryo-serializers', version: '0.37'
5552
compile group: 'com.cedarsoftware', name: 'java-util', version: '1.19.3'
5653
testCompile group: 'junit', name: 'junit', version:'4.11'
5754
testCompile group: 'ch.qos.logback', name: 'logback-classic', version:'1.1.2'

libs/kryo-serializers-0.37.jar

-81.5 KB
Binary file not shown.

libs/kryo-shaded-3.0.3.jar

-350 KB
Binary file not shown.

libs/minlog-1.3-SNAPHOT.jar

-5.52 KB
Binary file not shown.

pom.xml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
<groupId>com.chaschev</groupId>
5050
<artifactId>chutils</artifactId>
5151
<version>1.4</version>
52-
<!--We're only interested in ASCIITable from this library, so exclude all
53-
transitive dependencies -->
52+
<!--We're only interested in ASCIITable from this library, so exclude
53+
all transitive dependencies -->
5454
<exclusions>
5555
<exclusion>
5656
<groupId>org.mockito</groupId>
@@ -128,21 +128,6 @@
128128
<version>2.45</version>
129129
</dependency>
130130
<dependency>
131-
<groupId>com.esotericsoftware</groupId>
132-
<artifactId>kryo-shaded</artifactId>
133-
<version>3.0.3</version>
134-
</dependency>
135-
<dependency>
136-
<groupId>com.esotericsoftware</groupId>
137-
<artifactId>minlog</artifactId>
138-
<version>1.3-SNAPHOT</version>
139-
</dependency>
140-
<dependency>
141-
<groupId>de.javakaffee</groupId>
142-
<artifactId>kryo-serializers</artifactId>
143-
<version>0.37</version>
144-
</dependency>
145-
<dependency>
146131
<groupId>org.openjdk.jmh</groupId>
147132
<artifactId>jmh-core</artifactId>
148133
<version>1.11.3</version>

src/main/java/org/numenta/nupic/algorithms/TemporalMemory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ public void burstColumns(Connections c, ComputeCycle cycle,
204204
activeColumns.removeAll(predictedColumns);
205205

206206
for(Column column : activeColumns) {
207+
if(column == null || column.getCells() == null) {
208+
System.out.println("here");
209+
}
207210
List<Cell> cells = column.getCells();
208211
cycle.activeCells.addAll(cells);
209212

src/main/java/org/numenta/nupic/network/CheckPointer.java renamed to src/main/java/org/numenta/nupic/network/CheckPointOp.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,33 @@
2828
* <p>
2929
* Executes check point behavior through the {@link #checkPoint(Observer)} method. The
3030
* checkPoint() method adds the specified {@link rx.Observer} to the list of those
31-
* observers notified following a check point operation. The notification consists of
31+
* observers notified following a check point operation. This "subscribe" action invokes
32+
* the underlying check point operation and returns a notification. The notification consists of
3233
* a byte[] containing the serialized {@link Network}.
3334
* </p><p>
3435
* <b>Typical usage is as follows:</b>
3536
* <pre>
36-
* {@link Network} network = ...
37+
* {@link Persistence} p = Persistence.get();
3738
*
38-
* network.checkPointer().checkPoint(new Observer<byte[]>() {
39+
* p.checkPointOp().checkPoint(new Observer<byte[]>() {
3940
* public void onCompleted() {}
4041
* public void onError(Throwable e) { e.printStackTrace(); }
4142
* public void onNext(byte[] bytes) {
4243
* // Do work here, use serialized Network byte[] here if desired...
4344
* }
4445
* });
4546
*
46-
* Merely by adding this Observer, the Network knows to check point after completion of
47+
* Again, by subscribing to this CheckPointOp, the Network knows to check point after completion of
4748
* the current compute cycle (it checks the List of Observers to see if it's non-empty).
4849
* Then after it notifies all current observers, it clears the list prior to the next
49-
* following compute cycle. see {@link PersistenceAPI} for a more detailed discussion...
50+
* following compute cycle. see {@link PAPI} for a more detailed discussion...
5051
*
5152
* @author cogmission
5253
*
53-
* @param <T> a {@link Network}
54+
* @param <T> the notification return type
5455
*/
5556
@FunctionalInterface
56-
public interface CheckPointer<T> {
57+
public interface CheckPointOp<T> {
5758
/**
5859
* Registers the Observer for a single notification following the checkPoint
5960
* operation. The user will be notified with the byte[] of the {@link Network}

src/main/java/org/numenta/nupic/network/KryoSerializer.java

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)