Add missing javadoc
Change-Id: I56341d938aaa1eed95c12c76b24b9411be0362d6
diff --git a/src/main/java/net/onrc/onos/core/datastore/IKVClient.java b/src/main/java/net/onrc/onos/core/datastore/IKVClient.java
index 2a7d4f5..d3129bc 100644
--- a/src/main/java/net/onrc/onos/core/datastore/IKVClient.java
+++ b/src/main/java/net/onrc/onos/core/datastore/IKVClient.java
@@ -10,6 +10,14 @@
*/
public interface IKVClient {
+ /**
+ * Gets a table for name {@code tableName}.
+ *
+ * Table will be created, if it does not exist.
+ *
+ * @param tableName name of the table
+ * @return {@link IKVTable} for {@code tableName}
+ */
public IKVTable getTable(final String tableName);
/**
@@ -113,22 +121,54 @@
public Iterable<IKVEntry> getAllEntries(IKVTableID tableId);
/**
+ * Creates a {@code IMultiEntryOperation}.
+ *
* @return IMultiOpEntry for this operation
* @see #create(IKVTableID, byte[], byte[])
*/
public IMultiEntryOperation createOp(IKVTableID tableId, byte[] key, byte[] value);
+ /**
+ * Creates a {@code IMultiEntryOperation}.
+ *
+ * @return IMultiOpEntry for this operation
+ * @see #forceCreate(IKVTableID, byte[], byte[])
+ */
public IMultiEntryOperation forceCreateOp(IKVTableID tableId, byte[] key,
byte[] value);
+ /**
+ * Creates a {@code IMultiEntryOperation}.
+ *
+ * @return IMultiOpEntry for this operation
+ * @see #read(IKVTableID, byte[])
+ */
public IMultiEntryOperation readOp(IKVTableID tableId, byte[] key);
+ /**
+ * Creates a {@code IMultiEntryOperation}.
+ *
+ * @return IMultiOpEntry for this operation
+ * @see #update(IKVTableID, byte[], byte[], long)
+ */
public IMultiEntryOperation updateOp(IKVTableID tableId, byte[] key, byte[] value,
long version);
+ /**
+ * Creates a {@code IMultiEntryOperation}.
+ *
+ * @return IMultiOpEntry for this operation
+ * @see #delete(IKVTableID, byte[], long)
+ */
public IMultiEntryOperation deleteOp(IKVTableID tableId, byte[] key, byte[] value,
long version);
+ /**
+ * Creates a {@code IMultiEntryOperation}.
+ *
+ * @return IMultiOpEntry for this operation
+ * @see #forceDelete(IKVTableID, byte[])
+ */
public IMultiEntryOperation forceDeleteOp(IKVTableID tableId, byte[] key);
/**
@@ -209,6 +249,8 @@
/**
* Version number which represents that the object does not exist, or has
* never been read the DB before.
+ *
+ * @return Version number which represents that the object does not exist
*/
public long getVersionNonexistant();
diff --git a/src/main/java/net/onrc/onos/core/datastore/utils/KryoSerializer.java b/src/main/java/net/onrc/onos/core/datastore/utils/KryoSerializer.java
index bcc2736..26d4fd1 100644
--- a/src/main/java/net/onrc/onos/core/datastore/utils/KryoSerializer.java
+++ b/src/main/java/net/onrc/onos/core/datastore/utils/KryoSerializer.java
@@ -1,5 +1,7 @@
package net.onrc.onos.core.datastore.utils;
+import javax.annotation.concurrent.ThreadSafe;
+
import net.onrc.onos.core.datastore.DataStoreClient;
import com.esotericsoftware.kryo.io.Input;
@@ -8,11 +10,17 @@
/**
* {@link Serializer} implementation using Kryo.
*/
+@ThreadSafe
public final class KryoSerializer
implements Serializer {
private final ThreadLocalKryo kryo;
+ /**
+ * Thread safe Serializer implementation using Kryo.
+ *
+ * @param expectedTypes list of classes expected to be serialized
+ */
public KryoSerializer(Class<?>... expectedTypes) {
kryo = new ThreadLocalKryo(expectedTypes);
}