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 2017/05/31 23:13:02 UTC
[14/14] geode git commit: GEODE-2632: refactoring preparations for
SecurityService and BaseCommand changes
GEODE-2632: refactoring preparations for SecurityService and BaseCommand changes
Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/d1ec508e
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/d1ec508e
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/d1ec508e
Branch: refs/heads/develop
Commit: d1ec508ee628f75d1f26dbfd6db5a237745623b5
Parents: f7e1ba2
Author: Kirk Lund <kl...@apache.org>
Authored: Thu May 18 13:28:38 2017 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Wed May 31 16:11:34 2017 -0700
----------------------------------------------------------------------
.../java/org/apache/geode/GemFireException.java | 94 +-
.../java/org/apache/geode/Instantiator.java | 143 +-
.../org/apache/geode/cache/CacheException.java | 14 +-
.../geode/cache/CacheRuntimeException.java | 17 +-
.../geode/cache/client/internal/AbstractOp.java | 2 +-
.../geode/cache/client/internal/PingOp.java | 10 +-
.../org/apache/geode/internal/DSFIDFactory.java | 2 +-
.../geode/internal/cache/PartitionedRegion.java | 3 +-
.../internal/cache/tier/CachedRegionHelper.java | 18 +-
.../geode/internal/cache/tier/Command.java | 17 +-
.../cache/tier/sockets/BaseCommand.java | 762 +++---
.../cache/tier/sockets/BaseCommandQuery.java | 20 +-
.../cache/tier/sockets/CacheClientNotifier.java | 112 +-
.../cache/tier/sockets/CacheClientProxy.java | 4 +-
.../cache/tier/sockets/CacheClientUpdater.java | 867 ++++---
.../cache/tier/sockets/ChunkedMessage.java | 21 +-
.../internal/cache/tier/sockets/Message.java | 581 ++---
.../cache/tier/sockets/ServerConnection.java | 68 +-
.../ServerInterestRegistrationMessage.java | 121 +
.../cache/tier/sockets/command/AddPdxEnum.java | 23 +-
.../cache/tier/sockets/command/AddPdxType.java | 23 +-
.../cache/tier/sockets/command/ClearRegion.java | 56 +-
.../cache/tier/sockets/command/ClientReady.java | 24 +-
.../tier/sockets/command/CloseConnection.java | 33 +-
.../tier/sockets/command/CommitCommand.java | 25 +-
.../cache/tier/sockets/command/ContainsKey.java | 49 +-
.../tier/sockets/command/ContainsKey66.java | 51 +-
.../tier/sockets/command/CreateRegion.java | 48 +-
.../cache/tier/sockets/command/Default.java | 11 +-
.../cache/tier/sockets/command/Destroy.java | 79 +-
.../cache/tier/sockets/command/Destroy65.java | 116 +-
.../cache/tier/sockets/command/Destroy70.java | 4 +-
.../tier/sockets/command/DestroyRegion.java | 76 +-
.../tier/sockets/command/ExecuteFunction.java | 27 +-
.../tier/sockets/command/ExecuteFunction65.java | 31 +-
.../tier/sockets/command/ExecuteFunction66.java | 41 +-
.../tier/sockets/command/ExecuteFunction70.java | 5 +-
.../sockets/command/ExecuteRegionFunction.java | 37 +-
.../command/ExecuteRegionFunction61.java | 41 +-
.../command/ExecuteRegionFunction65.java | 41 +-
.../command/ExecuteRegionFunction66.java | 45 +-
.../command/ExecuteRegionFunctionSingleHop.java | 47 +-
.../sockets/command/GatewayReceiverCommand.java | 219 +-
.../cache/tier/sockets/command/Get70.java | 78 +-
.../cache/tier/sockets/command/GetAll.java | 54 +-
.../cache/tier/sockets/command/GetAll651.java | 55 +-
.../cache/tier/sockets/command/GetAll70.java | 57 +-
.../cache/tier/sockets/command/GetAllForRI.java | 2 +-
.../sockets/command/GetAllWithCallback.java | 60 +-
.../command/GetClientPRMetadataCommand.java | 28 +-
.../command/GetClientPRMetadataCommand66.java | 28 +-
.../GetClientPartitionAttributesCommand.java | 28 +-
.../GetClientPartitionAttributesCommand66.java | 28 +-
.../sockets/command/GetFunctionAttribute.java | 17 +-
.../tier/sockets/command/GetPDXEnumById.java | 25 +-
.../tier/sockets/command/GetPDXIdForEnum.java | 23 +-
.../tier/sockets/command/GetPDXIdForType.java | 25 +-
.../tier/sockets/command/GetPDXTypeById.java | 25 +-
.../tier/sockets/command/GetPdxEnums70.java | 22 +-
.../tier/sockets/command/GetPdxTypes70.java | 22 +-
.../cache/tier/sockets/command/Invalid.java | 10 +-
.../cache/tier/sockets/command/Invalidate.java | 78 +-
.../tier/sockets/command/Invalidate70.java | 4 +-
.../cache/tier/sockets/command/KeySet.java | 61 +-
.../cache/tier/sockets/command/MakePrimary.java | 25 +-
.../tier/sockets/command/ManagementCommand.java | 2 +-
.../cache/tier/sockets/command/PeriodicAck.java | 33 +-
.../cache/tier/sockets/command/Ping.java | 31 +-
.../cache/tier/sockets/command/Put.java | 95 +-
.../cache/tier/sockets/command/Put61.java | 112 +-
.../cache/tier/sockets/command/Put65.java | 165 +-
.../cache/tier/sockets/command/Put70.java | 4 +-
.../cache/tier/sockets/command/PutAll.java | 93 +-
.../cache/tier/sockets/command/PutAll70.java | 109 +-
.../cache/tier/sockets/command/PutAll80.java | 125 +-
.../sockets/command/PutUserCredentials.java | 33 +-
.../cache/tier/sockets/command/Query.java | 27 +-
.../cache/tier/sockets/command/Query651.java | 43 +-
.../command/RegisterDataSerializers.java | 34 +-
.../sockets/command/RegisterInstantiators.java | 40 +-
.../tier/sockets/command/RegisterInterest.java | 95 +-
.../sockets/command/RegisterInterest61.java | 105 +-
.../sockets/command/RegisterInterestList.java | 92 +-
.../sockets/command/RegisterInterestList61.java | 98 +-
.../sockets/command/RegisterInterestList66.java | 95 +-
.../cache/tier/sockets/command/RemoveAll.java | 109 +-
.../tier/sockets/command/RemoveUserAuth.java | 32 +-
.../cache/tier/sockets/command/Request.java | 72 +-
.../tier/sockets/command/RequestEventValue.java | 58 +-
.../tier/sockets/command/RollbackCommand.java | 20 +-
.../cache/tier/sockets/command/Size.java | 36 +-
.../tier/sockets/command/TXFailoverCommand.java | 28 +-
.../command/TXSynchronizationCommand.java | 56 +-
.../sockets/command/UnregisterInterest.java | 54 +-
.../sockets/command/UnregisterInterestList.java | 53 +-
.../command/UpdateClientNotification.java | 5 +-
.../apache/geode/internal/tcp/Connection.java | 2 +-
.../org/apache/geode/internal/util/IOUtils.java | 6 +-
.../geode/distributed/ServerLauncherUtils.java | 30 +
.../ha/BlockingHARegionQueueJUnitTest.java | 169 +-
.../cache/ha/HARegionQueueJUnitTest.java | 2307 +++++++++---------
.../cache/tier/sockets/CacheServerUtils.java | 55 +
.../cache/tier/sockets/MessageJUnitTest.java | 64 +-
.../internal/JUnit4DistributedTestCase.java | 2 +-
.../sanctionedDataSerializables.txt | 1074 ++++----
.../cache/tier/sockets/command/CloseCQ.java | 38 +-
.../cache/tier/sockets/command/ExecuteCQ.java | 45 +-
.../cache/tier/sockets/command/ExecuteCQ61.java | 57 +-
.../cache/tier/sockets/command/GetCQStats.java | 33 +-
.../tier/sockets/command/GetDurableCQs.java | 44 +-
.../cache/tier/sockets/command/MonitorCQ.java | 37 +-
.../cache/tier/sockets/command/StopCQ.java | 38 +-
.../geode/test/junit/categories/UnitTest.java | 2 +-
.../SerializableErrorCollector.java | 22 +
...arallelGatewaySenderOperationsDUnitTest.java | 17 +-
115 files changed, 5375 insertions(+), 5404 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/d1ec508e/geode-core/src/main/java/org/apache/geode/GemFireException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/GemFireException.java b/geode-core/src/main/java/org/apache/geode/GemFireException.java
index 02bf025..cd80019 100644
--- a/geode-core/src/main/java/org/apache/geode/GemFireException.java
+++ b/geode-core/src/main/java/org/apache/geode/GemFireException.java
@@ -12,76 +12,56 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
-
package org.apache.geode;
/**
* This is the abstract superclass of exceptions that are thrown to indicate incorrect usage of
* GemFire.
- *
+ * <p>
* Since these exceptions are unchecked, this class really <em>ought</em> to be called
- * <code>GemFireRuntimeException</code>; however, the current name is retained for compatibility's
- * sake.
- *
- * @see org.apache.geode.GemFireCheckedException
+ * {@code GemFireRuntimeException}; however, the current name is retained for compatibility's sake.
+ * <p>
+ * This class is abstract to enforce throwing more specific exception types. Please avoid using
+ * GemFireException to describe an arbitrary error condition
+ *
+ * @see GemFireCheckedException
* @see org.apache.geode.cache.CacheRuntimeException
*/
-// Implementation note: This class is abstract so that we are forced
-// to have more specific exception types. We want to avoid using
-// GemFireException to describe an arbitrary error condition (think
-// GsError).
public abstract class GemFireException extends RuntimeException {
- public static final long serialVersionUID = -6972360779789402295L;
-
- /** The cause of this <code>GemFireException</code> */
- // private Throwable cause;
-
- ////////////////////// Constructors //////////////////////
+ private static final long serialVersionUID = -6972360779789402295L;
/**
- * Creates a new <code>GemFireException</code> with no detailed message.
+ * Creates a new {@code GemFireException} with no detailed message.
*/
public GemFireException() {
super();
}
/**
- * Creates a new <code>GemFireException</code> with the given detail message.
+ * Creates a new {@code GemFireException} with the given detail message.
*/
public GemFireException(String message) {
super(message);
}
/**
- * Creates a new <code>GemFireException</code> with the given detail message and cause.
+ * Creates a new {@code GemFireException} with the given detail message and cause.
*/
public GemFireException(String message, Throwable cause) {
super(message, cause);
- // this.cause = cause;
}
/**
- * Creates a new <code>GemFireException</code> with the given cause and no detail message
+ * Creates a new {@code GemFireException} with the given cause and no detail message
*/
public GemFireException(Throwable cause) {
super(cause);
- // this.cause = cause;
}
- //////////////////// Instance Methods ////////////////////
-
/**
- * Returns the cause of this <code>GemFireException</code> or <code>null</code> if the cause is
+ * Returns the root cause of this {@code GemFireException} or {@code null} if the cause is
* nonexistent or unknown.
*/
- // public Throwable getCause() {
- // return this.cause;
- // }
-
- /**
- * Returns the root cause of this <code>GemFireException</code> or <code>null</code> if the cause
- * is nonexistent or unknown.
- */
public Throwable getRootCause() {
if (this.getCause() == null) {
return null;
@@ -93,52 +73,4 @@ public abstract class GemFireException extends RuntimeException {
return root;
}
- // public void printStackTrace() {
- // super.printStackTrace();
- // if (this.cause != null) {
- // System.err.println("Caused by:");
- // this.cause.printStackTrace();
- // }
- // }
-
- // public void printStackTrace(java.io.PrintWriter pw) {
- // super.printStackTrace(pw);
- //
- // if (this.cause != null) {
- // pw.println("Caused by:");
- // this.cause.printStackTrace(pw);
- // }
- // }
- //
- // public String getMessage() {
- // if (this.cause != null) {
- // String ourMsg = super.getMessage();
- // if (ourMsg == null || ourMsg.length() == 0) {
- // //ourMsg = super.toString(); //causes inifinite recursion
- // ourMsg = "";
- // }
- // StringBuffer sb = new StringBuffer(ourMsg);
- // sb.append(" Caused by: ");
- // String causeMsg = this.cause.getMessage();
- // if (causeMsg == null || causeMsg.length() == 0) {
- // causeMsg = this.cause.toString();
- // }
- // sb.append(causeMsg);
- // return sb.toString();
- // } else {
- // return super.getMessage();
- // }
- // }
-
- /**
- * Represent the receiver as well as the cause
- */
- // public String toString() {
- // String result = super.toString();
- // if (cause != null) {
- // result = result + ", caused by " + cause.toString();
- // }
- // return result;
- // }
-
}
http://git-wip-us.apache.org/repos/asf/geode/blob/d1ec508e/geode-core/src/main/java/org/apache/geode/Instantiator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/Instantiator.java b/geode-core/src/main/java/org/apache/geode/Instantiator.java
index 3c1ca06..ea42057 100644
--- a/geode-core/src/main/java/org/apache/geode/Instantiator.java
+++ b/geode-core/src/main/java/org/apache/geode/Instantiator.java
@@ -20,16 +20,16 @@ import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
import org.apache.geode.internal.i18n.LocalizedStrings;
/**
- * <code>Instantiator</code> allows classes that implement {@link DataSerializable} to be registered
- * with the data serialization framework. Knowledge of <code>DataSerializable</code> classes allows
- * the framework to optimize how instances of those classes are data serialized.
+ * {@code Instantiator} allows classes that implement {@link DataSerializable} to be registered with
+ * the data serialization framework. Knowledge of {@code DataSerializable} classes allows the
+ * framework to optimize how instances of those classes are data serialized.
*
* <P>
*
- * Ordinarily, when a <code>DataSerializable</code> object is written using
+ * Ordinarily, when a {@code DataSerializable} object is written using
* {@link DataSerializer#writeObject(Object, java.io.DataOutput)}, a special marker class id is
- * written to the stream followed by the class name of the <code>DataSerializable</code> object.
- * After the marker class id is read by {@link DataSerializer#readObject} it performs the following
+ * written to the stream followed by the class name of the {@code DataSerializable} object. After
+ * the marker class id is read by {@link DataSerializer#readObject} it performs the following
* operations,
*
* <OL>
@@ -44,23 +44,20 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
*
* </OL>
*
- * However, if a <code>DataSerializable</code> class is {@linkplain #register(Instantiator)
- * registered} with the data serialization framework and assigned a unique class id, an important
- * optimization can be performed that avoid the expense of using reflection to instantiate the
- * <code>DataSerializable</code> class. When the object is written using
+ * However, if a {@code DataSerializable} class is {@linkplain #register(Instantiator) registered}
+ * with the data serialization framework and assigned a unique class id, an important optimization
+ * can be performed that avoid the expense of using reflection to instantiate the
+ * {@code DataSerializable} class. When the object is written using
* {@link DataSerializer#writeObject(Object, java.io.DataOutput)}, the object's registered class id
* is written to the stream. Consequently, when the data is read from the stream, the
- * {@link #newInstance} method of the appropriate <code>Instantiator</code> instance is invoked to
- * create an "empty" instance of the <code>DataSerializable</code> instead of using reflection to
- * create the new instance.
+ * {@link #newInstance} method of the appropriate {@code Instantiator} instance is invoked to create
+ * an "empty" instance of the {@code DataSerializable} instead of using reflection to create the new
+ * instance.
*
* <P>
*
- * Commonly, a <code>DataSerializable</code> class will register itself with the
- * <code>Instantiator</code> in a static initializer as shown in the below example code.
- *
- * <!-- The source code for the CompanySerializer class resides in tests/com/examples/ds/User.java
- * Please keep the below code snippet in sync with that file. -->
+ * Commonly, a {@code DataSerializable} class will register itself with the {@code Instantiator} in
+ * a static initializer as shown in the below example code.
*
* <PRE>
public class User implements DataSerializable {
@@ -101,22 +98,21 @@ public class User implements DataSerializable {
}
* </PRE>
*
- * <code>Instantiator</code>s may be distributed to other members of the distributed system when
- * they are registered. Consider the following scenario in which VM1 and VM2 are members of the same
+ * {@code Instantiator}s may be distributed to other members of the distributed system when they are
+ * registered. Consider the following scenario in which VM1 and VM2 are members of the same
* distributed system. Both VMs define the sameRegion and VM2's region replicates the contents of
- * VM1's using replication. VM1 puts an instance of the above <code>User</code> class into the
- * region. The act of instantiating <code>User</code> will load the <code>User</code> class and
- * invoke its static initializer, thus registering the <code>Instantiator</code> with the data
- * serialization framework. Because the region is a replicate, the <code>User</code> will be data
- * serialized and sent to VM2. However, when VM2 attempts to data deserialize the <code>User</code>,
- * its <code>Instantiator</code> will not necessarily be registered because <code>User</code>'s
- * static initializer may not have been invoked yet. As a result, an exception would be logged while
- * deserializing the <code>User</code> and the replicate would not appear to have the new value. So,
- * in order to ensure that the <code>Instantiator</code> is registered in VM2, the data
- * serialization framework distributes a message to each member when an <code>Instantiator</code> is
- * {@linkplain #register(Instantiator) registered}.
+ * VM1's using replication. VM1 puts an instance of the above {@code User} class into the region.
+ * The act of instantiating {@code User} will load the {@code User} class and invoke its static
+ * initializer, thus registering the {@code Instantiator} with the data serialization framework.
+ * Because the region is a replicate, the {@code User} will be data serialized and sent to VM2.
+ * However, when VM2 attempts to data deserialize the {@code User}, its {@code Instantiator} will
+ * not necessarily be registered because {@code User}'s static initializer may not have been invoked
+ * yet. As a result, an exception would be logged while deserializing the {@code User} and the
+ * replicate would not appear to have the new value. So, in order to ensure that the
+ * {@code Instantiator} is registered in VM2, the data serialization framework distributes a message
+ * to each member when an {@code Instantiator} is {@linkplain #register(Instantiator) registered}.
* <p>
- * Note that the framework does not require that an <code>Instantiator</code> be
+ * Note that the framework does not require that an {@code Instantiator} be
* {@link java.io.Serializable}, but it does require that it provide a
* {@linkplain #Instantiator(Class, int) two-argument constructor}.
*
@@ -133,63 +129,64 @@ public abstract class Instantiator {
*/
private Class<? extends DataSerializable> clazz;
- /** The id of this <code>Instantiator</code> */
+ /** The id of this {@code Instantiator} */
private int id;
- /** The eventId of this <code>Instantiator</code> */
+ /** The eventId of this {@code Instantiator} */
private EventID eventId;
- /** The originator of this <code>Instantiator</code> */
+ /** The originator of this {@code Instantiator} */
private ClientProxyMembershipID context;
/**
- * Registers a <code>DataSerializable</code> class with the data serialization framework. This
- * method is usually invoked from the static initializer of a class that implements
- * <code>DataSerializable</code>.
+ * Registers a {@code DataSerializable} class with the data serialization framework. This method
+ * is usually invoked from the static initializer of a class that implements
+ * {@code DataSerializable}.
*
- * @param instantiator An <code>Instantiator</code> whose {@link #newInstance} method is invoked
- * when an object is data deserialized.
+ * @param instantiator An {@code Instantiator} whose {@link #newInstance} method is invoked when
+ * an object is data deserialized.
*
- * @throws IllegalStateException If class <code>c</code> is already registered with a different
- * class id, or another class has already been registered with id <code>classId</code>
- * @throws NullPointerException If <code>instantiator</code> is <code>null</code>.
+ * @throws IllegalStateException If class {@code c} is already registered with a different class
+ * id, or another class has already been registered with id {@code classId}
+ * @throws NullPointerException If {@code instantiator} is {@code null}.
*/
public static synchronized void register(Instantiator instantiator) {
InternalInstantiator.register(instantiator, true);
}
/**
- * Registers a <code>DataSerializable</code> class with the data serialization framework. This
- * method is usually invoked from the static initializer of a class that implements
- * <code>DataSerializable</code>.
+ * Registers a {@code DataSerializable} class with the data serialization framework. This method
+ * is usually invoked from the static initializer of a class that implements
+ * {@code DataSerializable}.
*
- * @param instantiator An <code>Instantiator</code> whose {@link #newInstance} method is invoked
- * when an object is data deserialized.
+ * @param instantiator An {@code Instantiator} whose {@link #newInstance} method is invoked when
+ * an object is data deserialized.
*
- * @param distribute True if the registered <code>Instantiator</code> has to be distributed to
- * other members of the distributed system. Note that if distribute is set to false it may
- * still be distributed in some cases.
+ * @param distribute True if the registered {@code Instantiator} has to be distributed to other
+ * members of the distributed system. Note that if distribute is set to false it may still
+ * be distributed in some cases.
*
- * @throws IllegalArgumentException If class <code>c</code> is already registered with a different
- * class id, or another class has already been registered with id <code>classId</code>
- * @throws NullPointerException If <code>instantiator</code> is <code>null</code>.
+ * @throws IllegalArgumentException If class {@code c} is already registered with a different
+ * class id, or another class has already been registered with id {@code classId}
+ * @throws NullPointerException If {@code instantiator} is {@code null}.
* @deprecated as of 9.0 use {@link Instantiator#register(Instantiator)} instead
*/
+ @Deprecated
public static synchronized void register(Instantiator instantiator, boolean distribute) {
InternalInstantiator.register(instantiator, distribute);
}
/**
- * Creates a new <code>Instantiator</code> that instantiates a given class.
+ * Creates a new {@code Instantiator} that instantiates a given class.
*
- * @param c The <code>DataSerializable</code> class to register. This class must have a static
- * initializer that registers this <code>Instantiator</code>.
- * @param classId A unique id for class <code>c</code>. The <code>classId</code> must not be zero.
- * This has been an <code>int</code> since dsPhase1.
+ * @param c The {@code DataSerializable} class to register. This class must have a static
+ * initializer that registers this {@code Instantiator}.
+ * @param classId A unique id for class {@code c}. The {@code classId} must not be zero. This has
+ * been an {@code int} since dsPhase1.
*
- * @throws IllegalArgumentException If <code>c</code> does not implement
- * <code>DataSerializable</code>, <code>classId</code> is less than or equal to zero.
- * @throws NullPointerException If <code>c</code> is <code>null</code>
+ * @throws IllegalArgumentException If {@code c} does not implement {@code DataSerializable},
+ * {@code classId} is less than or equal to zero.
+ * @throws NullPointerException If {@code c} is {@code null}
*/
public Instantiator(Class<? extends DataSerializable> c, int classId) {
if (c == null) {
@@ -204,8 +201,8 @@ public abstract class Instantiator {
}
if (classId == 0) {
- throw new IllegalArgumentException(LocalizedStrings.Instantiator_CLASS_ID_0_MUST_NOT_BE_0
- .toLocalizedString(Integer.valueOf(classId)));
+ throw new IllegalArgumentException(
+ LocalizedStrings.Instantiator_CLASS_ID_0_MUST_NOT_BE_0.toLocalizedString(classId));
}
this.clazz = c;
@@ -213,52 +210,50 @@ public abstract class Instantiator {
}
/**
- * Creates a new "empty" instance of a <Code>DataSerializable</code> class whose state will be
- * filled in by invoking its {@link DataSerializable#fromData fromData} method.
+ * Creates a new "empty" instance of a {@code DataSerializable} class whose state will be filled
+ * in by invoking its {@link DataSerializable#fromData fromData} method.
*
* @see DataSerializer#readObject
*/
public abstract DataSerializable newInstance();
/**
- * Returns the <code>DataSerializable</code> class that is instantiated by this
- * <code>Instantiator</code>.
+ * Returns the {@code DataSerializable} class that is instantiated by this {@code Instantiator}.
*/
public Class<? extends DataSerializable> getInstantiatedClass() {
return this.clazz;
}
/**
- * Returns the unique <code>id</code> of this <code>Instantiator</code>.
+ * Returns the unique {@code id} of this {@code Instantiator}.
*/
public int getId() {
return this.id;
}
/**
- * sets the unique <code>eventId</code> of this <code>Instantiator</code>. For internal use only.
+ * sets the unique {@code eventId} of this {@code Instantiator}. For internal use only.
*/
public void setEventId(Object/* EventID */ eventId) {
this.eventId = (EventID) eventId;
}
/**
- * Returns the unique <code>eventId</code> of this <code>Instantiator</code>. For internal use
- * only.
+ * Returns the unique {@code eventId} of this {@code Instantiator}. For internal use only.
*/
public Object/* EventID */ getEventId() {
return this.eventId;
}
/**
- * sets the context of this <code>Instantiator</code>. For internal use only.
+ * sets the context of this {@code Instantiator}. For internal use only.
*/
public void setContext(Object/* ClientProxyMembershipID */ context) {
this.context = (ClientProxyMembershipID) context;
}
/**
- * Returns the context of this <code>Instantiator</code>. For internal use only.
+ * Returns the context of this {@code Instantiator}. For internal use only.
*/
public Object/* ClientProxyMembershipID */ getContext() {
return this.context;
http://git-wip-us.apache.org/repos/asf/geode/blob/d1ec508e/geode-core/src/main/java/org/apache/geode/cache/CacheException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheException.java b/geode-core/src/main/java/org/apache/geode/cache/CacheException.java
index 79591d6..6309ad1 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/CacheException.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/CacheException.java
@@ -16,36 +16,34 @@ package org.apache.geode.cache;
import org.apache.geode.GemFireException;
-
/**
* A generic exception, which indicates a cache error has occurred. All the other cache exceptions
* are subclasses of this class. This class is abstract and therefore only subclasses are
* instantiated.
*
- *
* @since GemFire 2.0
*/
public abstract class CacheException extends GemFireException {
- public static final long serialVersionUID = 7699432887938858940L;
+ private static final long serialVersionUID = 7699432887938858940L;
- /** Constructs a new <code>CacheException</code>. */
+ /** Constructs a new {@code CacheException}. */
public CacheException() {
super();
}
- /** Constructs a new <code>CacheException</code> with a message string. */
+ /** Constructs a new {@code CacheException} with a message string. */
public CacheException(String s) {
super(s);
}
/**
- * Constructs a <code>CacheException</code> with a message string and a base exception
+ * Constructs a {@code CacheException} with a message string and a base exception
*/
public CacheException(String s, Throwable cause) {
super(s, cause);
}
- /** Constructs a <code>CacheException</code> with a cause */
+ /** Constructs a {@code CacheException} with a cause */
public CacheException(Throwable cause) {
super(cause);
}
@@ -57,7 +55,7 @@ public abstract class CacheException extends GemFireException {
if (cause != null) {
String causeStr = cause.toString();
final String glue = ", caused by ";
- StringBuffer sb = new StringBuffer(result.length() + causeStr.length() + glue.length());
+ StringBuilder sb = new StringBuilder(result.length() + causeStr.length() + glue.length());
sb.append(result).append(glue).append(causeStr);
result = sb.toString();
}
http://git-wip-us.apache.org/repos/asf/geode/blob/d1ec508e/geode-core/src/main/java/org/apache/geode/cache/CacheRuntimeException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheRuntimeException.java b/geode-core/src/main/java/org/apache/geode/cache/CacheRuntimeException.java
index a723b32..7732e96 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/CacheRuntimeException.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/CacheRuntimeException.java
@@ -12,7 +12,6 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
-
package org.apache.geode.cache;
import org.apache.geode.GemFireException;
@@ -22,20 +21,18 @@ import org.apache.geode.GemFireException;
* cache exceptions are the subclass of this class. This class is abstract so only subclasses can be
* instantiated
*
- *
* @since GemFire 3.0
*/
public abstract class CacheRuntimeException extends GemFireException {
- public static final long serialVersionUID = 6750107573015376688L;
+ private static final long serialVersionUID = 6750107573015376688L;
/**
- * Creates a new instance of <code>CacheRuntimeException</code> without detail message.
+ * Creates a new instance of {@code CacheRuntimeException} without detail message.
*/
public CacheRuntimeException() {}
-
/**
- * Constructs an instance of <code>CacheRuntimeException</code> with the specified detail message.
+ * Constructs an instance of {@code CacheRuntimeException} with the specified detail message.
*
* @param msg the detail message
*/
@@ -44,8 +41,8 @@ public abstract class CacheRuntimeException extends GemFireException {
}
/**
- * Constructs an instance of <code>CacheRuntimeException</code> with the specified detail message
- * and cause.
+ * Constructs an instance of {@code CacheRuntimeException} with the specified detail message and
+ * cause.
*
* @param msg the detail message
* @param cause the causal Throwable
@@ -55,7 +52,7 @@ public abstract class CacheRuntimeException extends GemFireException {
}
/**
- * Constructs an instance of <code>CacheRuntimeException</code> with the specified cause.
+ * Constructs an instance of {@code CacheRuntimeException} with the specified cause.
*
* @param cause the causal Throwable
*/
@@ -70,7 +67,7 @@ public abstract class CacheRuntimeException extends GemFireException {
if (cause != null) {
String causeStr = cause.toString();
final String glue = ", caused by ";
- StringBuffer sb = new StringBuffer(result.length() + causeStr.length() + glue.length());
+ StringBuilder sb = new StringBuilder(result.length() + causeStr.length() + glue.length());
sb.append(result).append(glue).append(causeStr);
result = sb.toString();
}
http://git-wip-us.apache.org/repos/asf/geode/blob/d1ec508e/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
index a0cb7d4..7af4f4f 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
@@ -228,7 +228,7 @@ public abstract class AbstractOp implements Op {
protected abstract Object processResponse(Message msg) throws Exception;
/**
- * Return true of <code>msgType</code> indicates the operation had an error on the server.
+ * Return true of <code>messageType</code> indicates the operation had an error on the server.
*/
protected abstract boolean isErrorResponse(int msgType);
http://git-wip-us.apache.org/repos/asf/geode/blob/d1ec508e/geode-core/src/main/java/org/apache/geode/cache/client/internal/PingOp.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/PingOp.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/PingOp.java
index cc30f1c..2e52542 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/PingOp.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/PingOp.java
@@ -14,7 +14,6 @@
*/
package org.apache.geode.cache.client.internal;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.distributed.internal.ServerLocation;
import org.apache.geode.internal.cache.tier.MessageType;
import org.apache.geode.internal.cache.tier.sockets.Message;
@@ -25,6 +24,7 @@ import org.apache.geode.internal.cache.tier.sockets.Message;
* @since GemFire 5.7
*/
public class PingOp {
+
/**
* Ping the specified server to see if it is still alive
*
@@ -47,13 +47,13 @@ public class PingOp {
/**
* @throws org.apache.geode.SerializationException if serialization fails
*/
- public PingOpImpl() {
+ PingOpImpl() {
super(MessageType.PING, 0);
}
@Override
protected void processSecureBytes(Connection cnx, Message message) throws Exception {
- Message.messageType.set(null);
+ Message.MESSAGE_TYPE.set(null);
}
@Override
@@ -64,9 +64,9 @@ public class PingOp {
@Override
protected void sendMessage(Connection cnx) throws Exception {
getMessage().clearMessageHasSecurePartFlag();
- startTime = System.currentTimeMillis();
+ this.startTime = System.currentTimeMillis();
getMessage().send(false);
- Message.messageType.set(MessageType.PING);
+ Message.MESSAGE_TYPE.set(MessageType.PING);
}
@Override
http://git-wip-us.apache.org/repos/asf/geode/blob/d1ec508e/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java b/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java
index ac500e6..5b0d86b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java
@@ -372,7 +372,7 @@ import org.apache.geode.internal.cache.snapshot.FlowController.FlowControlAbortM
import org.apache.geode.internal.cache.snapshot.FlowController.FlowControlAckMessage;
import org.apache.geode.internal.cache.snapshot.SnapshotPacket;
import org.apache.geode.internal.cache.snapshot.SnapshotPacket.SnapshotRecord;
-import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier.ServerInterestRegistrationMessage;
+import org.apache.geode.internal.cache.tier.sockets.ServerInterestRegistrationMessage;
import org.apache.geode.internal.cache.tier.sockets.ClientBlacklistProcessor.ClientBlacklistMessage;
import org.apache.geode.internal.cache.tier.sockets.ClientDataSerializerMessage;
import org.apache.geode.internal.cache.tier.sockets.ClientInstantiatorMessage;
http://git-wip-us.apache.org/repos/asf/geode/blob/d1ec508e/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
index 8d4eaf7..02d04b3 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
@@ -183,7 +183,6 @@ import org.apache.geode.internal.cache.partitioned.ContainsKeyValueMessage;
import org.apache.geode.internal.cache.partitioned.ContainsKeyValueMessage.ContainsKeyValueResponse;
import org.apache.geode.internal.cache.partitioned.DestroyMessage;
import org.apache.geode.internal.cache.partitioned.DestroyMessage.DestroyResponse;
-import org.apache.geode.internal.cache.partitioned.DestroyRegionOnDataStoreMessage;
import org.apache.geode.internal.cache.partitioned.DumpAllPRConfigMessage;
import org.apache.geode.internal.cache.partitioned.DumpB2NRegion;
import org.apache.geode.internal.cache.partitioned.DumpB2NRegion.DumpB2NResponse;
@@ -4479,7 +4478,7 @@ public class PartitionedRegion extends LocalRegion
values.addObjectPart(key, ge.value, ge.isObject, ge.versionTag);
}
- if (values.size() == BaseCommand.maximumChunkSize) {
+ if (values.size() == BaseCommand.MAXIMUM_CHUNK_SIZE) {
BaseCommand.sendNewRegisterInterestResponseChunk(this, "keyList", values, false,
servConn);
values.clear();
http://git-wip-us.apache.org/repos/asf/geode/blob/d1ec508e/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java
index a82a804..940da95 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java
@@ -27,21 +27,19 @@ import org.apache.geode.internal.cache.InternalCache;
public class CachedRegionHelper {
private final InternalCache cache;
+
private volatile boolean shutdown = false;
- // private Map regions;
- private volatile int slowEmulationSleep = 0;
- public CachedRegionHelper(InternalCache c) {
- this.cache = c;
- // this.regions = new WeakHashMap();
+ public CachedRegionHelper(InternalCache cache) {
+ this.cache = cache;
}
public void checkCancelInProgress(Throwable e) throws CancelException {
- cache.getCancelCriterion().checkCancelInProgress(e);
+ this.cache.getCancelCriterion().checkCancelInProgress(e);
}
public Region getRegion(String name) {
- return cache.getRegion(name);
+ return this.cache.getRegion(name);
}
public InternalCache getCache() {
@@ -53,12 +51,14 @@ public class CachedRegionHelper {
}
public boolean isShutdown() {
- return shutdown || cache.getCancelCriterion().isCancelInProgress();
+ return this.shutdown || this.cache.getCancelCriterion().isCancelInProgress();
}
+ /**
+ * CachedRegionHelper#close() does nothing
+ */
public void close() {
// cache = null;
- // regions = null;
}
/**
http://git-wip-us.apache.org/repos/asf/geode/blob/d1ec508e/geode-core/src/main/java/org/apache/geode/internal/cache/tier/Command.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/Command.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/Command.java
index 0c1c42a..d7f7c7b 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/Command.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/Command.java
@@ -12,22 +12,17 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
-/**
- *
- */
package org.apache.geode.internal.cache.tier;
-import org.apache.geode.internal.cache.tier.sockets.*;
+import org.apache.geode.internal.cache.tier.sockets.Message;
+import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
-/**
- *
- */
public interface Command {
- public void execute(Message msg, ServerConnection servConn);
+ void execute(Message message, ServerConnection serverConnection);
- public final int RESPONDED = 1;
+ int RESPONDED = 1;
- public final int REQUIRES_RESPONSE = 2;
+ int REQUIRES_RESPONSE = 2;
- public final int REQUIRES_CHUNKED_RESPONSE = 3;
+ int REQUIRES_CHUNKED_RESPONSE = 3;
}