You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2018/07/09 21:20:11 UTC
[geode] branch develop updated (b79b64a -> 1564e56)
This is an automated email from the ASF dual-hosted git repository.
klund pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git.
from b79b64a GEODE-5383: Check that data propagated earlier
new 023b495 GEODE-5390: Use @Override in DiskInitFile and DiskInitFileParser
new 1de96e4 GEODE-5390: Move inner classes to end of DiskInitFile
new 3482a10 GEODE-5390: Move inner classes to end of Oplog
new 6ef4e4a GEODE-5390: Fix log statements in DiskInitFileParser
new 172c6a9 GEODE-5390: Improve trace level log statement in Oplog
new 0e8ecd9 GEODE-5391: Fix toString of RegionVersionHolder
new 1564e56 GEODE-5392: Cleanup javadocs and code style in AsyncInvocation
The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../apache/geode/internal/cache/DiskInitFile.java | 56 +++-
.../org/apache/geode/internal/cache/Oplog.java | 348 ++++++++++-----------
.../cache/persistence/DiskInitFileParser.java | 8 +-
.../cache/versions/RegionVersionHolder.java | 1 +
.../sanctioned-geode-core-serializables.txt | 1 -
.../apache/geode/test/dunit/AsyncInvocation.java | 61 ++--
6 files changed, 243 insertions(+), 232 deletions(-)
[geode] 07/07: GEODE-5392: Cleanup javadocs and code style in
AsyncInvocation
Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 1564e5624e5fd660b01a31d0b0d1b8ca95e5f238
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Tue Jun 26 10:22:30 2018 -0700
GEODE-5392: Cleanup javadocs and code style in AsyncInvocation
---
.../apache/geode/test/dunit/AsyncInvocation.java | 61 +++++++++-------------
1 file changed, 25 insertions(+), 36 deletions(-)
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java b/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
index ba80318..9c8f83b 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/AsyncInvocation.java
@@ -36,14 +36,8 @@ import org.apache.geode.SystemFailure;
* AsyncInvocation ai1 = vm.invokeAsync(() -> Test.method1());
* AsyncInvocation ai2 = vm.invokeAsync(() -> Test.method2());
*
- * ai1.join();
- * ai2.join();
- *
- * assertTrue("Exception occurred while invoking " + ai1,
- * !ai1.exceptionOccurred());
- * if (ai2.exceptionOccurred()) {
- * throw ai2.getException();
- * }
+ * ai1.await();
+ * ai2.await();
* </pre>
*
* @param <V> The result type returned by this AsyncInvocation's {@code get} methods
@@ -52,11 +46,6 @@ import org.apache.geode.SystemFailure;
*/
public class AsyncInvocation<V> implements Future<V> {
- // TODO:davidw: Add the ability to get a return value back from the
- // async method call. (Use a static ThreadLocal field that is
- // accessible from the Runnable used in VM#invoke)
- // TODO:?: reimplement using Futures
-
private static final long DEFAULT_JOIN_MILLIS = 60 * 1000;
private final Thread thread;
@@ -85,7 +74,7 @@ public class AsyncInvocation<V> implements Future<V> {
public AsyncInvocation(final Object target, final String methodName, final Callable<V> work) {
this.target = target;
this.methodName = methodName;
- this.thread =
+ thread =
new Thread(new AsyncInvocationGroup(), runnable(work), getName(target, methodName));
}
@@ -95,7 +84,7 @@ public class AsyncInvocation<V> implements Future<V> {
* @deprecated This method is not required for anything.
*/
public Object getTarget() {
- return this.target;
+ return target;
}
/**
@@ -104,7 +93,7 @@ public class AsyncInvocation<V> implements Future<V> {
* @deprecated This method is not required for anything.
*/
public String getMethodName() {
- return this.methodName;
+ return methodName;
}
/**
@@ -128,11 +117,11 @@ public class AsyncInvocation<V> implements Future<V> {
throw new AssertionError(illegalStateException);
}
- if (this.resultThrowable.get() instanceof RMIException) { // TODO:klund: delete our RMIException
- return this.resultThrowable.get().getCause();
+ if (resultThrowable.get() instanceof RMIException) { // TODO: delete our RMIException
+ return resultThrowable.get().getCause();
} else {
- return this.resultThrowable.get();
+ return resultThrowable.get();
}
}
@@ -145,7 +134,7 @@ public class AsyncInvocation<V> implements Future<V> {
* @throws AssertionError wrapping any {@code Exception} thrown by this {@code AsyncInvocation}.
*/
public AsyncInvocation<V> checkException() {
- if (this.resultThrowable.get() != null) {
+ if (resultThrowable.get() != null) {
throw new AssertionError("An exception occurred during asynchronous invocation.",
getException());
}
@@ -171,7 +160,7 @@ public class AsyncInvocation<V> implements Future<V> {
join();
checkException();
checkIsDone("Return value not available while thread is alive.");
- return this.resultValue.get();
+ return resultValue.get();
}
/**
@@ -211,7 +200,7 @@ public class AsyncInvocation<V> implements Future<V> {
*/
public V getReturnValue() {
checkIsDone("Return value not available while thread is alive.");
- return this.resultValue.get();
+ return resultValue.get();
}
/**
@@ -227,7 +216,7 @@ public class AsyncInvocation<V> implements Future<V> {
* @throws InterruptedException if the current thread is interrupted.
*/
public synchronized AsyncInvocation<V> join(final long millis) throws InterruptedException {
- this.thread.join(millis);
+ thread.join(millis);
return this;
}
@@ -247,7 +236,7 @@ public class AsyncInvocation<V> implements Future<V> {
*/
public synchronized AsyncInvocation<V> join(final long millis, final int nanos)
throws InterruptedException {
- this.thread.join(millis, nanos);
+ thread.join(millis, nanos);
return this;
}
@@ -271,7 +260,7 @@ public class AsyncInvocation<V> implements Future<V> {
* @return this {@code AsyncInvocation}
*/
public synchronized AsyncInvocation<V> start() {
- this.thread.start();
+ thread.start();
return this;
}
@@ -281,7 +270,7 @@ public class AsyncInvocation<V> implements Future<V> {
* @return this {@code AsyncInvocation}'s work thread.
*/
public synchronized Thread getThread() {
- return this.thread;
+ return thread;
}
/**
@@ -292,25 +281,25 @@ public class AsyncInvocation<V> implements Future<V> {
* otherwise.
*/
public synchronized boolean isAlive() {
- return this.thread.isAlive();
+ return thread.isAlive();
}
@Override
public synchronized boolean isCancelled() {
- return this.cancelled;
+ return cancelled;
}
@Override
public synchronized boolean isDone() {
- return !this.thread.isAlive(); // state != NEW;
+ return !thread.isAlive(); // state != NEW;
}
@Override
public synchronized boolean cancel(final boolean mayInterruptIfRunning) {
- if (this.thread.isAlive()) {
+ if (thread.isAlive()) {
if (mayInterruptIfRunning) {
- this.cancelled = true;
- this.thread.interrupt();
+ cancelled = true;
+ thread.interrupt();
return true;
}
}
@@ -422,7 +411,7 @@ public class AsyncInvocation<V> implements Future<V> {
join(millis);
timeoutIfAlive(millis);
checkException();
- return this.resultValue.get();
+ return resultValue.get();
}
/**
@@ -434,7 +423,7 @@ public class AsyncInvocation<V> implements Future<V> {
* @return this {@code AsyncInvocation}'s thread's ID.
*/
public long getId() {
- return this.thread.getId();
+ return thread.getId();
}
@Override
@@ -452,7 +441,7 @@ public class AsyncInvocation<V> implements Future<V> {
* @throws IllegalStateException if this {@code AsyncInvocation} is not done.
*/
private AsyncInvocation<V> checkIsDone(final String message) {
- if (this.thread.isAlive()) {
+ if (thread.isAlive()) {
throw new IllegalStateException(message);
}
return this;
@@ -469,7 +458,7 @@ public class AsyncInvocation<V> implements Future<V> {
* timeout of 60 seconds as defined by {@link #DEFAULT_JOIN_MILLIS}.
*/
private AsyncInvocation<V> timeoutIfAlive(final long timeout) throws TimeoutException {
- if (this.thread.isAlive()) {
+ if (thread.isAlive()) {
throw new TimeoutException(
"Timed out waiting " + timeout + " milliseconds for AsyncInvocation to complete.");
}
[geode] 03/07: GEODE-5390: Move inner classes to end of Oplog
Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 3482a10c1334918e4ed9faea83bc95d84842ef93
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Fri Jun 22 12:33:33 2018 -0700
GEODE-5390: Move inner classes to end of Oplog
---
.../org/apache/geode/internal/cache/Oplog.java | 346 ++++++++++-----------
.../sanctioned-geode-core-serializables.txt | 1 -
2 files changed, 167 insertions(+), 180 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
index b1fdcd1..6157bc8 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
@@ -508,28 +508,6 @@ public class Oplog implements CompactableOplog, Flushable {
*/
static final byte OPLOG_MAGIC_SEQ_ID = 92;
- public enum OPLOG_TYPE {
- CRF(new byte[] {0x47, 0x46, 0x43, 0x52, 0x46, 0x31}), // GFCRF1
- DRF(new byte[] {0x47, 0x46, 0x44, 0x52, 0x46, 0x31}), // GFDRF1
- IRF(new byte[] {0x47, 0x46, 0x49, 0x52, 0x46, 0x31}), // GFIRF1
- KRF(new byte[] {0x47, 0x46, 0x4b, 0x52, 0x46, 0x31}), // GFKRF1
- IF(new byte[] {0x47, 0x46, 0x49, 0x46, 0x30, 0x31}); // GFIF01
-
- private final byte[] bytes;
-
- OPLOG_TYPE(byte[] byteSeq) {
- this.bytes = byteSeq;
- }
-
- public byte[] getBytes() {
- return bytes;
- }
-
- public static int getLen() {
- return 6;
- }
- }
-
public static final int OPLOG_MAGIC_SEQ_REC_SIZE = 1 + OPLOG_TYPE.getLen() + 1;
/** Compact this oplogs or no. A client configurable property * */
@@ -3805,40 +3783,6 @@ public class Oplog implements CompactableOplog, Flushable {
});
}
- /**
- * Used when creating a KRF to keep track of what DiskRegionView a DiskEntry belongs to.
- */
- private static class KRFEntry {
- private final DiskEntry de;
- private final DiskRegionView drv;
- /**
- * Fix for 42733 - a stable snapshot of the offset so we can sort It doesn't matter that this is
- * stale, we'll filter out these entries later.
- */
- private final long offsetInOplog;
- private VersionHolder versionTag;
-
- public KRFEntry(DiskRegionView drv, DiskEntry de, VersionHolder tag) {
- this.de = de;
- this.drv = drv;
- DiskId diskId = de.getDiskId();
- this.offsetInOplog = diskId != null ? diskId.getOffsetInOplog() : 0;
- this.versionTag = tag;
- }
-
- public DiskEntry getDiskEntry() {
- return this.de;
- }
-
- public DiskRegionView getDiskRegionView() {
- return this.drv;
- }
-
- public long getOffsetInOplogForSorting() {
- return offsetInOplog;
- }
- }
-
private void writeOneKeyEntryForKRF(KRFEntry ke) throws IOException {
DiskEntry de = ke.getDiskEntry();
long diskRegionId = ke.getDiskRegionView().getId();
@@ -6311,26 +6255,6 @@ public class Oplog implements CompactableOplog, Flushable {
return chPrev;
}
- private static class OplogFile {
- public File f;
- public UninterruptibleRandomAccessFile raf;
- public volatile boolean RAFClosed = true;
- public UninterruptibleFileChannel channel;
- public ByteBuffer writeBuf;
- public long currSize;
- public long bytesFlushed;
- public boolean unpreblown;
- }
-
- private static class KRFile {
- public File f;
- FileOutputStream fos;
- BufferedOutputStream bos;
- DataOutputStream dos;
- long lastOffset = 0;
- int keyNum = 0;
- }
-
private static String baToString(byte[] ba) {
return baToString(ba, ba != null ? ba.length : 0);
}
@@ -6390,6 +6314,168 @@ public class Oplog implements CompactableOplog, Flushable {
InternalDataSerializer.writeSignedVL(dsId, out);
}
+ public void finishKrf() {
+ createKrf(false);
+ }
+
+ void prepareForClose() {
+ try {
+ finishKrf();
+ } catch (CancelException e) {
+ // workaround for 50465
+ if (logger.isDebugEnabled()) {
+ logger.debug("Got a cancel exception while creating a krf during shutown", e);
+ }
+ }
+ }
+
+ private Object deserializeKey(byte[] keyBytes, final Version version,
+ final ByteArrayDataInput in) {
+ if (!getParent().isOffline() || !PdxWriterImpl.isPdx(keyBytes)) {
+ return EntryEventImpl.deserialize(keyBytes, version, in);
+ } else {
+ return new RawByteKey(keyBytes);
+ }
+ }
+
+ /**
+ * If this OpLog is from an older version of the product, then return that {@link Version} else
+ * return null.
+ */
+ public Version getProductVersionIfOld() {
+ final Version version = this.gfversion;
+ if (version == null) {
+ // check for the case of diskstore upgrade from 6.6 to >= 7.0
+ if (getParent().isUpgradeVersionOnly()) {
+ // assume previous release version
+ return Version.GFE_66;
+ } else {
+ return null;
+ }
+ } else if (version == Version.CURRENT) {
+ return null;
+ } else {
+ // version changed so return that for VersionedDataStream
+ return version;
+ }
+ }
+
+ /**
+ * If this OpLog has data that was written by an older version of the product, then return that
+ * {@link Version} else return null.
+ */
+ public Version getDataVersionIfOld() {
+ final Version version = this.dataVersion;
+ if (version == null) {
+ // check for the case of diskstore upgrade from 6.6 to >= 7.0
+ if (getParent().isUpgradeVersionOnly()) {
+ // assume previous release version
+ return Version.GFE_66;
+ } else {
+ return null;
+ }
+ } else if (version == Version.CURRENT) {
+ return null;
+ } else {
+ // version changed so return that for VersionedDataStream
+ return version;
+ }
+ }
+
+ public enum OPLOG_TYPE {
+ CRF(new byte[] {0x47, 0x46, 0x43, 0x52, 0x46, 0x31}), // GFCRF1
+ DRF(new byte[] {0x47, 0x46, 0x44, 0x52, 0x46, 0x31}), // GFDRF1
+ IRF(new byte[] {0x47, 0x46, 0x49, 0x52, 0x46, 0x31}), // GFIRF1
+ KRF(new byte[] {0x47, 0x46, 0x4b, 0x52, 0x46, 0x31}), // GFKRF1
+ IF(new byte[] {0x47, 0x46, 0x49, 0x46, 0x30, 0x31}); // GFIF01
+
+ private final byte[] bytes;
+
+ OPLOG_TYPE(byte[] byteSeq) {
+ this.bytes = byteSeq;
+ }
+
+ public byte[] getBytes() {
+ return bytes;
+ }
+
+ public static int getLen() {
+ return 6;
+ }
+ }
+
+ /**
+ * Enumeration of the possible results of the okToSkipModifyRecord
+ */
+ private enum OkToSkipResult {
+ SKIP_RECORD, // Skip reading the key and value
+ SKIP_VALUE, // skip reading just the value
+ DONT_SKIP; // don't skip the record
+
+ public boolean skip() {
+ return this != DONT_SKIP;
+ }
+
+ public boolean skipKey() {
+ return this == SKIP_RECORD;
+ }
+
+ }
+
+ /**
+ * Used when creating a KRF to keep track of what DiskRegionView a DiskEntry belongs to.
+ */
+ private static class KRFEntry {
+ private final DiskEntry de;
+ private final DiskRegionView drv;
+ /**
+ * Fix for 42733 - a stable snapshot of the offset so we can sort It doesn't matter that this is
+ * stale, we'll filter out these entries later.
+ */
+ private final long offsetInOplog;
+ private VersionHolder versionTag;
+
+ public KRFEntry(DiskRegionView drv, DiskEntry de, VersionHolder tag) {
+ this.de = de;
+ this.drv = drv;
+ DiskId diskId = de.getDiskId();
+ this.offsetInOplog = diskId != null ? diskId.getOffsetInOplog() : 0;
+ this.versionTag = tag;
+ }
+
+ public DiskEntry getDiskEntry() {
+ return this.de;
+ }
+
+ public DiskRegionView getDiskRegionView() {
+ return this.drv;
+ }
+
+ public long getOffsetInOplogForSorting() {
+ return offsetInOplog;
+ }
+ }
+
+ private static class OplogFile {
+ public File f;
+ public UninterruptibleRandomAccessFile raf;
+ public volatile boolean RAFClosed = true;
+ public UninterruptibleFileChannel channel;
+ public ByteBuffer writeBuf;
+ public long currSize;
+ public long bytesFlushed;
+ public boolean unpreblown;
+ }
+
+ private static class KRFile {
+ public File f;
+ FileOutputStream fos;
+ BufferedOutputStream bos;
+ DataOutputStream dos;
+ long lastOffset = 0;
+ int keyNum = 0;
+ }
+
/**
* Holds all the state for the current operation. Since an oplog can only have one operation in
* progress at any given time we only need a single instance of this class per oplog.
@@ -7300,7 +7386,7 @@ public class Oplog implements CompactableOplog, Flushable {
/**
* Used as the value in the regionMap. Tracks information about what the region has in this oplog.
*/
- public interface DiskRegionInfo {
+ private interface DiskRegionInfo {
DiskRegionView getDiskRegion();
int addLiveEntriesToList(KRFEntry[] liveEntries, int idx);
@@ -7337,7 +7423,7 @@ public class Oplog implements CompactableOplog, Flushable {
void afterKrfCreated();
}
- public abstract static class AbstractDiskRegionInfo implements DiskRegionInfo {
+ private abstract static class AbstractDiskRegionInfo implements DiskRegionInfo {
private DiskRegionView dr;
private boolean unrecovered = false;
@@ -7390,7 +7476,7 @@ public class Oplog implements CompactableOplog, Flushable {
}
}
- public static class DiskRegionInfoNoList extends AbstractDiskRegionInfo {
+ private static class DiskRegionInfoNoList extends AbstractDiskRegionInfo {
private final AtomicInteger liveCount = new AtomicInteger();
public DiskRegionInfoNoList(DiskRegionView dr) {
@@ -7437,7 +7523,7 @@ public class Oplog implements CompactableOplog, Flushable {
}
}
- public static class DiskRegionInfoWithList extends AbstractDiskRegionInfo {
+ private static class DiskRegionInfoWithList extends AbstractDiskRegionInfo {
/**
* A linked list of the live entries in this oplog. Updates to pendingKrfTags are protected by
* synchronizing on object.
@@ -7618,7 +7704,7 @@ public class Oplog implements CompactableOplog, Flushable {
return new Iterator();
}
- public class Iterator {
+ class Iterator {
private boolean doingInt = true;
ObjectIterator<Int2ObjectMap.Entry<?>> intIt = ints.int2ObjectEntrySet().fastIterator();
ObjectIterator<Long2ObjectMap.Entry<?>> longIt = longs.long2ObjectEntrySet().fastIterator();
@@ -7660,74 +7746,6 @@ public class Oplog implements CompactableOplog, Flushable {
}
}
- public void finishKrf() {
- createKrf(false);
- }
-
- void prepareForClose() {
- try {
- finishKrf();
- } catch (CancelException e) {
- // workaround for 50465
- if (logger.isDebugEnabled()) {
- logger.debug("Got a cancel exception while creating a krf during shutown", e);
- }
- }
- }
-
- private Object deserializeKey(byte[] keyBytes, final Version version,
- final ByteArrayDataInput in) {
- if (!getParent().isOffline() || !PdxWriterImpl.isPdx(keyBytes)) {
- return EntryEventImpl.deserialize(keyBytes, version, in);
- } else {
- return new RawByteKey(keyBytes);
- }
- }
-
- /**
- * If this OpLog is from an older version of the product, then return that {@link Version} else
- * return null.
- */
- public Version getProductVersionIfOld() {
- final Version version = this.gfversion;
- if (version == null) {
- // check for the case of diskstore upgrade from 6.6 to >= 7.0
- if (getParent().isUpgradeVersionOnly()) {
- // assume previous release version
- return Version.GFE_66;
- } else {
- return null;
- }
- } else if (version == Version.CURRENT) {
- return null;
- } else {
- // version changed so return that for VersionedDataStream
- return version;
- }
- }
-
- /**
- * If this OpLog has data that was written by an older version of the product, then return that
- * {@link Version} else return null.
- */
- public Version getDataVersionIfOld() {
- final Version version = this.dataVersion;
- if (version == null) {
- // check for the case of diskstore upgrade from 6.6 to >= 7.0
- if (getParent().isUpgradeVersionOnly()) {
- // assume previous release version
- return Version.GFE_66;
- } else {
- return null;
- }
- } else if (version == Version.CURRENT) {
- return null;
- } else {
- // version changed so return that for VersionedDataStream
- return version;
- }
- }
-
/**
* Used in offline mode to prevent pdx deserialization of keys. The raw bytes are a serialized
* pdx.
@@ -7763,34 +7781,4 @@ public class Oplog implements CompactableOplog, Flushable {
}
- /**
- * Enumeration of operation log file types.
- *
- */
- enum OplogFileType {
- OPLOG_CRF, // Creates and updates
- OPLOG_DRF, // Deletes
- OPLOG_KRF // Keys
- }
-
- /**
- * Enumeration of the possible results of the okToSkipModifyRecord
- *
- *
- */
- private static enum OkToSkipResult {
- SKIP_RECORD, // Skip reading the key and value
- SKIP_VALUE, // skip reading just the value
- DONT_SKIP; // don't skip the record
-
- public boolean skip() {
- return this != DONT_SKIP;
- }
-
- public boolean skipKey() {
- return this == SKIP_RECORD;
- }
-
- }
-
}
diff --git a/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt b/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt
index 623d59f..6df6ea0 100644
--- a/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt
+++ b/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt
@@ -288,7 +288,6 @@ org/apache/geode/internal/cache/InitialImageOperation$GIITestHookType,false
org/apache/geode/internal/cache/LocalRegion$1,true,0,this$0:org/apache/geode/internal/cache/LocalRegion
org/apache/geode/internal/cache/LocalRegion$IteratorType,false
org/apache/geode/internal/cache/Oplog$OkToSkipResult,false
-org/apache/geode/internal/cache/Oplog$OplogFileType,false
org/apache/geode/internal/cache/PartitionAttributesImpl,false
org/apache/geode/internal/cache/PRContainsValueFunction,false
org/apache/geode/internal/cache/PRHARedundancyProvider$ArrayListWithClearState,true,1,wasCleared:boolean
[geode] 02/07: GEODE-5390: Move inner classes to end of DiskInitFile
Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 1de96e4d2cbfab3d2bbc26f1d616292eb0a45dac
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Fri Jun 22 11:05:46 2018 -0700
GEODE-5390: Move inner classes to end of DiskInitFile
---
.../apache/geode/internal/cache/DiskInitFile.java | 26 +++++++++++-----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
index a8b5313..8da0b6c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
@@ -2397,19 +2397,6 @@ public class DiskInitFile implements DiskInitFileInterpreter {
}
}
- /**
- * Additional flags for a disk region that are persisted in its meta-data.
- *
- * @since GemFire 7.0
- */
- public enum DiskRegionFlag {
- /**
- * True if this disk region has entries with versioning enabled. Depending on this flag, the
- * appropriate RegionEntryFactory gets instantiated.
- */
- IS_WITH_VERSIONING
- }
-
Collection<DiskRegionView> getKnown() {
lock(false);
try {
@@ -2822,4 +2809,17 @@ public class DiskInitFile implements DiskInitFileInterpreter {
unlock(true);
}
}
+
+ /**
+ * Additional flags for a disk region that are persisted in its meta-data.
+ *
+ * @since GemFire 7.0
+ */
+ public enum DiskRegionFlag {
+ /**
+ * True if this disk region has entries with versioning enabled. Depending on this flag, the
+ * appropriate RegionEntryFactory gets instantiated.
+ */
+ IS_WITH_VERSIONING
+ }
}
[geode] 04/07: GEODE-5390: Fix log statements in DiskInitFileParser
Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 6ef4e4a80f65a4fb23ee9191d6701292dd9e1df0
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Fri Jun 22 13:34:31 2018 -0700
GEODE-5390: Fix log statements in DiskInitFileParser
---
.../geode/internal/cache/persistence/DiskInitFileParser.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskInitFileParser.java b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskInitFileParser.java
index 822793e..b488237 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskInitFileParser.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskInitFileParser.java
@@ -155,7 +155,8 @@ public class DiskInitFileParser {
String regName = dis.readUTF();
readEndOfRecord(dis);
if (logger.isTraceEnabled(LogMarker.PERSIST_RECOVERY_VERBOSE)) {
- logger.trace(LogMarker.PERSIST_RECOVERY_VERBOSE, "IFREC_CREATE_REGION_ID drId= name={}",
+ logger.trace(LogMarker.PERSIST_RECOVERY_VERBOSE,
+ "IFREC_CREATE_REGION_ID drId={} name={}",
drId, regName);
}
interpreter.cmnCreateRegion(drId, regName);
@@ -650,7 +651,9 @@ public class DiskInitFileParser {
out.append(",");
}
out.replace(out.length() - 1, out.length(), ")");
- System.out.println(out.toString());
+ if (logger.isDebugEnabled()) {
+ logger.debug(out.toString());
+ }
if (delegate == null) {
return result;
} else {
[geode] 06/07: GEODE-5391: Fix toString of RegionVersionHolder
Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 0e8ecd910fbe879da002371b218a42f5e15b62f8
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Mon Jun 25 12:45:44 2018 -0700
GEODE-5391: Fix toString of RegionVersionHolder
---
.../org/apache/geode/internal/cache/versions/RegionVersionHolder.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/versions/RegionVersionHolder.java b/geode-core/src/main/java/org/apache/geode/internal/cache/versions/RegionVersionHolder.java
index 6c7a5ac..4a39486 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/versions/RegionVersionHolder.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/versions/RegionVersionHolder.java
@@ -180,6 +180,7 @@ public class RegionVersionHolder<T> implements Cloneable, DataSerializable {
if (this.exceptions != null && !this.exceptions.isEmpty()) {
sb.append(this.exceptions.toString());
}
+ sb.append("}");
return sb.toString();
}
[geode] 01/07: GEODE-5390: Use @Override in DiskInitFile and
DiskInitFileParser
Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 023b495fa5df81a1683cd4d2999c96d3c67cb524
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Fri Jun 22 11:04:26 2018 -0700
GEODE-5390: Use @Override in DiskInitFile and DiskInitFileParser
---
.../apache/geode/internal/cache/DiskInitFile.java | 30 ++++++++++++++++++++++
.../cache/persistence/DiskInitFileParser.java | 1 +
2 files changed, 31 insertions(+)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
index 9a6137d..a8b5313 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
@@ -505,6 +505,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
return result;
}
+ @Override
public void cmnClearRegion(long drId, long clearOplogEntryId) {
DiskRegionView drv = getDiskRegionById(drId);
if (drv.getClearOplogEntryId() == DiskStoreImpl.INVALID_ID) {
@@ -518,6 +519,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
}
}
+ @Override
public void cmnClearRegion(long drId,
ConcurrentHashMap<DiskStoreID, RegionVersionHolder<DiskStoreID>> memberToVersion) {
DiskRegionView drv = getDiskRegionById(drId);
@@ -547,6 +549,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
}
}
+ @Override
public void cmnCreateRegion(long drId, String regName) {
recoverDiskRegion(drId, regName);
this.liveRegions++;
@@ -554,6 +557,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
this.ifTotalRecordCount++;
}
+ @Override
public void cmnRegionConfig(long drId, byte lruAlgorithm, byte lruAction, int lruLimit,
int concurrencyLevel, int initialCapacity, float loadFactor, boolean statisticsEnabled,
boolean isBucket, EnumSet<DiskRegionFlag> flags, String partitionName, int startingBucketId,
@@ -590,6 +594,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
}
}
+ @Override
public boolean cmnPRCreate(String name, PRPersistentConfig config) {
if (this.prMap.put(name, config) == null) {
this.ifLiveRecordCount++;
@@ -601,10 +606,12 @@ public class DiskInitFile implements DiskInitFileInterpreter {
return false;
}
+ @Override
public void cmnGemfireVersion(Version version) {
this.gfversion = version;
}
+ @Override
public boolean cmnPRDestroy(String name) {
if (this.prMap.remove(name) != null) {
this.ifLiveRecordCount--;
@@ -622,6 +629,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
this.ifTotalRecordCount++;
}
+ @Override
public void cmnRmMemberId(long drId, PersistentMemberID pmid) {
DiskRegionView dr = getDiskRegionById(drId);
if (dr != null) {
@@ -644,6 +652,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
}
}
+ @Override
public void cmnOfflineMemberId(long drId, PersistentMemberID pmid) {
DiskRegionView dr = getDiskRegionById(drId);
if (dr != null) {
@@ -662,6 +671,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
}
}
+ @Override
public void cmdOfflineAndEqualMemberId(long drId, PersistentMemberID pmid) {
DiskRegionView dr = getDiskRegionById(drId);
if (dr != null) {
@@ -688,6 +698,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
}
}
+ @Override
public void cmnOnlineMemberId(long drId, PersistentMemberID pmid) {
DiskRegionView dr = getDiskRegionById(drId);
if (dr != null) {
@@ -706,6 +717,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
}
}
+ @Override
public void cmnDataSerializerId(Class dsc) {
if (dsc != null) {
DataSerializer ds = InternalDataSerializer.register(dsc, /* dsId, */ true);
@@ -715,6 +727,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
this.ifTotalRecordCount++;
}
+ @Override
public void cmnInstantiatorId(int id, Class c, Class ic) {
if (c != null && ic != null) {
InternalInstantiator.register(c, ic, id, true);
@@ -724,6 +737,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
this.ifTotalRecordCount++;
}
+ @Override
public void cmnInstantiatorId(int id, String cn, String icn) {
if (cn != null && icn != null) {
InternalInstantiator.register(cn, icn, id, true);
@@ -733,24 +747,28 @@ public class DiskInitFile implements DiskInitFileInterpreter {
this.ifTotalRecordCount++;
}
+ @Override
public void cmnCrfCreate(long oplogId) {
this.crfIds.add(oplogId);
this.ifLiveRecordCount++;
this.ifTotalRecordCount++;
}
+ @Override
public void cmnDrfCreate(long oplogId) {
this.drfIds.add(oplogId);
this.ifLiveRecordCount++;
this.ifTotalRecordCount++;
}
+ @Override
public void cmnKrfCreate(long oplogId) {
this.krfIds.add(oplogId);
this.ifLiveRecordCount++;
this.ifTotalRecordCount++;
}
+ @Override
public boolean cmnCrfDelete(long oplogId) {
if (this.krfIds.remove(oplogId)) {
this.ifLiveRecordCount--;
@@ -765,6 +783,7 @@ public class DiskInitFile implements DiskInitFileInterpreter {
}
}
+ @Override
public boolean cmnDrfDelete(long oplogId) {
if (this.drfIds.remove(oplogId)) {
this.ifLiveRecordCount--;
@@ -1901,10 +1920,12 @@ public class DiskInitFile implements DiskInitFileInterpreter {
saveGemfireVersion(); // normal create diskstore
}
this.regListener = new InternalDataSerializer.RegistrationListener() {
+ @Override
public void newInstantiator(Instantiator i) {
saveInstantiator(i);
}
+ @Override
public void newDataSerializer(DataSerializer ds) {
saveDataSerializer(ds);
}
@@ -2398,27 +2419,33 @@ public class DiskInitFile implements DiskInitFileInterpreter {
}
}
+ @Override
public void cmnAddMyInitializingPMID(long drId, PersistentMemberID pmid) {
cmnAddMyInitializingPMID(getDiskRegionById(drId), pmid);
}
+ @Override
public void cmnBeginDestroyRegion(long drId) {
cmnBeginDestroyRegion(getDiskRegionById(drId));
}
+ @Override
public void cmnBeginPartialDestroyRegion(long drId) {
cmnBeginPartialDestroyRegion(getDiskRegionById(drId));
}
+ @Override
public void cmnEndDestroyRegion(long drId) {
cmnEndDestroyRegion(getDiskRegionById(drId));
}
+ @Override
public void cmnEndPartialDestroyRegion(long drId) {
cmnEndPartialDestroyRegion(getDiskRegionById(drId));
}
+ @Override
public void cmnMarkInitialized(long drId) {
cmnMarkInitialized(getDiskRegionById(drId));
}
@@ -2431,14 +2458,17 @@ public class DiskInitFile implements DiskInitFileInterpreter {
this.parent.setDiskStoreID(diskStoreID);
}
+ @Override
public boolean cmnRevokeDiskStoreId(PersistentMemberPattern revokedPattern) {
return this.revokedMembers.add(revokedPattern);
}
+ @Override
public String getNameForError() {
return this.parent.toString();
}
+ @Override
public boolean isClosing() {
return parent.isClosing();
}
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskInitFileParser.java b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskInitFileParser.java
index 56bc038..822793e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskInitFileParser.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskInitFileParser.java
@@ -629,6 +629,7 @@ public class DiskInitFileParser {
this.delegate = wrapped;
}
+ @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (method.getName().equals("isClosing")) {
if (delegate == null) {
[geode] 05/07: GEODE-5390: Improve trace level log statement in
Oplog
Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 172c6a981582dbd56756b66b0f5a7ad7a52cf2c8
Author: Kirk Lund <kl...@apache.org>
AuthorDate: Mon Jun 25 12:45:00 2018 -0700
GEODE-5390: Improve trace level log statement in Oplog
---
geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
index 6157bc8..d56061b 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
@@ -2160,7 +2160,7 @@ public class Oplog implements CompactableOplog, Flushable {
drs.recordRecoveredVersonHolder((VersionSource) member, versionHolder, latestOplog);
if (isPersistRecoveryDebugEnabled) {
logger.trace(LogMarker.PERSIST_RECOVERY_VERBOSE,
- "adding RVV entry drId={},member={},versionHolder={},latestOplog={},oplogId={}",
+ "adding RVV entry drId={}, member={}, versionHolder={}, latestOplog={}, oplogId={}",
drId, memberId, versionHolder, latestOplog, getOplogId());
}
} else {