Fix checkstyle whitespace issues - WHITESPACE ONLY
Change-Id: Ic205c1afd639c6008d61d9de95cb764eeb6238ca
diff --git a/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZClient.java b/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZClient.java
index d5107da..cbe10be 100644
--- a/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZClient.java
+++ b/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZClient.java
@@ -62,7 +62,7 @@
baseHzConfig = new FileSystemXmlConfig(hazelcastConfigFileName);
} catch (FileNotFoundException e) {
log.error("Error opening Hazelcast XML configuration. File not found: " + hazelcastConfigFileName, e);
- throw new Error("Cannot find Hazelcast configuration: " + hazelcastConfigFileName , e);
+ throw new Error("Cannot find Hazelcast configuration: " + hazelcastConfigFileName, e);
}
// use xml config if present, if not use System.property
@@ -118,6 +118,7 @@
/**
* Register serializer for VersionedValue class used to imitate value version.
+ *
* @param config
*/
private static void registerSerializer(final SerializationConfig config) {
@@ -178,7 +179,7 @@
@Override
public long update(final IKVTableID tableId, final byte[] key, final byte[] value,
- final long version) throws ObjectDoesntExistException,
+ final long version) throws ObjectDoesntExistException,
WrongVersionException {
IKVTable table = (IKVTable) tableId;
return table.update(key, value, version);
@@ -212,13 +213,13 @@
@Override
public IMultiEntryOperation createOp(final IKVTableID tableId, final byte[] key,
- final byte[] value) {
+ final byte[] value) {
return new HZMultiEntryOperation((HZTable) tableId, key, value, HZClient.VERSION_NONEXISTENT, OPERATION.CREATE);
}
@Override
public IMultiEntryOperation forceCreateOp(final IKVTableID tableId, final byte[] key,
- final byte[] value) {
+ final byte[] value) {
return new HZMultiEntryOperation((HZTable) tableId, key, value, HZClient.VERSION_NONEXISTENT, OPERATION.FORCE_CREATE);
}
@@ -229,13 +230,13 @@
@Override
public IMultiEntryOperation updateOp(final IKVTableID tableId, final byte[] key,
- final byte[] value, final long version) {
+ final byte[] value, final long version) {
return new HZMultiEntryOperation((HZTable) tableId, key, value, version, OPERATION.UPDATE);
}
@Override
public IMultiEntryOperation deleteOp(final IKVTableID tableId, final byte[] key,
- final byte[] value, final long version) {
+ final byte[] value, final long version) {
return new HZMultiEntryOperation((HZTable) tableId, key, value, version, OPERATION.DELETE);
}
@@ -250,24 +251,24 @@
for (IMultiEntryOperation op : ops) {
HZMultiEntryOperation mop = (HZMultiEntryOperation) op;
switch (mop.getOperation()) {
- case DELETE:
- try {
- final long version = delete(mop.getTableId(), mop.getKey(), mop.getVersion());
+ case DELETE:
+ try {
+ final long version = delete(mop.getTableId(), mop.getKey(), mop.getVersion());
+ mop.setVersion(version);
+ mop.setStatus(STATUS.SUCCESS);
+ } catch (ObjectDoesntExistException | WrongVersionException e) {
+ log.error(mop + " failed.", e);
+ mop.setStatus(STATUS.FAILED);
+ failExists = true;
+ }
+ break;
+ case FORCE_DELETE:
+ final long version = forceDelete(mop.getTableId(), mop.getKey());
mop.setVersion(version);
mop.setStatus(STATUS.SUCCESS);
- } catch (ObjectDoesntExistException | WrongVersionException e) {
- log.error(mop + " failed.", e);
- mop.setStatus(STATUS.FAILED);
- failExists = true;
- }
- break;
- case FORCE_DELETE:
- final long version = forceDelete(mop.getTableId(), mop.getKey());
- mop.setVersion(version);
- mop.setStatus(STATUS.SUCCESS);
- break;
- default:
- throw new UnsupportedOperationException(mop.toString());
+ break;
+ default:
+ throw new UnsupportedOperationException(mop.toString());
}
}
return failExists;
@@ -280,37 +281,36 @@
for (IMultiEntryOperation op : ops) {
IModifiableMultiEntryOperation mop = (IModifiableMultiEntryOperation) op;
switch (mop.getOperation()) {
- case CREATE:
- try {
- long version = create(mop.getTableId(), mop.getKey(), mop.getValue());
+ case CREATE:
+ try {
+ long version = create(mop.getTableId(), mop.getKey(), mop.getValue());
+ mop.setVersion(version);
+ mop.setStatus(STATUS.SUCCESS);
+ } catch (ObjectExistsException e) {
+ log.error(mop + " failed.", e);
+ mop.setStatus(STATUS.FAILED);
+ failExists = true;
+ }
+ break;
+ case FORCE_CREATE: {
+ final long version = forceCreate(mop.getTableId(), mop.getKey(), mop.getValue());
mop.setVersion(version);
mop.setStatus(STATUS.SUCCESS);
- } catch (ObjectExistsException e) {
- log.error(mop + " failed.", e);
- mop.setStatus(STATUS.FAILED);
- failExists = true;
+ break;
}
- break;
- case FORCE_CREATE:
- {
- final long version = forceCreate(mop.getTableId(), mop.getKey(), mop.getValue());
- mop.setVersion(version);
- mop.setStatus(STATUS.SUCCESS);
- break;
- }
- case UPDATE:
- try {
- long version = update(mop.getTableId(), mop.getKey(), mop.getValue(), mop.getVersion());
- mop.setVersion(version);
- mop.setStatus(STATUS.SUCCESS);
- } catch (ObjectDoesntExistException | WrongVersionException e) {
- log.error(mop + " failed.", e);
- mop.setStatus(STATUS.FAILED);
- failExists = true;
- }
- break;
- default:
- throw new UnsupportedOperationException(mop.toString());
+ case UPDATE:
+ try {
+ long version = update(mop.getTableId(), mop.getKey(), mop.getValue(), mop.getVersion());
+ mop.setVersion(version);
+ mop.setStatus(STATUS.SUCCESS);
+ } catch (ObjectDoesntExistException | WrongVersionException e) {
+ log.error(mop + " failed.", e);
+ mop.setStatus(STATUS.FAILED);
+ failExists = true;
+ }
+ break;
+ default:
+ throw new UnsupportedOperationException(mop.toString());
}
}
return failExists;
diff --git a/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZMultiEntryOperation.java b/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZMultiEntryOperation.java
index 105fc16..88649e7 100644
--- a/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZMultiEntryOperation.java
+++ b/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZMultiEntryOperation.java
@@ -28,6 +28,7 @@
/**
* Constructor for Read/ForceDelete Operation.
+ *
* @param table
* @param key
* @param operation
@@ -44,6 +45,7 @@
/**
* Constructor for Other Operations.
+ *
* @param table
* @param key
* @param value
@@ -108,6 +110,7 @@
/**
* Evaluate Future object and set Status and Value+Version.
+ *
* @return the value read or null on failure.
*/
private VersionedValue get() {
diff --git a/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZTable.java b/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZTable.java
index f071ecc..6cba576 100644
--- a/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZTable.java
+++ b/src/main/java/net/onrc/onos/core/datastore/hazelcast/HZTable.java
@@ -26,10 +26,11 @@
private static final Logger log = LoggerFactory.getLogger(HZTable.class);
// not sure how strict this should be managed
- private static final AtomicLong initialVersion = new AtomicLong(HZClient.VERSION_NONEXISTENT);
+ private static final AtomicLong initialVersion = new AtomicLong(HZClient.VERSION_NONEXISTENT);
/**
* generate a new initial version for an entry.
+ *
* @return initial value
*/
protected static long getInitialVersion() {
@@ -43,6 +44,7 @@
/**
* increment version, avoiding VERSION_NONEXISTENT.
+ *
* @param version
* @return
*/
@@ -185,7 +187,6 @@
}
-
private final String mapName;
private final IMap<byte[], VersionedValue> map;
diff --git a/src/main/java/net/onrc/onos/core/datastore/hazelcast/VersionedValueSerializableFactory.java b/src/main/java/net/onrc/onos/core/datastore/hazelcast/VersionedValueSerializableFactory.java
index 7e77be7..75bd568 100644
--- a/src/main/java/net/onrc/onos/core/datastore/hazelcast/VersionedValueSerializableFactory.java
+++ b/src/main/java/net/onrc/onos/core/datastore/hazelcast/VersionedValueSerializableFactory.java
@@ -13,11 +13,11 @@
@Override
public IdentifiedDataSerializable create(final int typeId) {
switch (typeId) {
- case VERSIONED_VALUE_ID:
- return new HZTable.VersionedValue();
+ case VERSIONED_VALUE_ID:
+ return new HZTable.VersionedValue();
- default:
- return null;
+ default:
+ return null;
}
}