Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public void run() {
getSessionsToTouch().clear();

// Touch the sessions we currently have
if (sessionIds != null && (!sessionIds.isEmpty())) {
if (!sessionIds.isEmpty()) {
getSessionCache().touchSessions(sessionIds);
if (getLogger().isDebugEnabled()) {
getLogger().debug(DeltaSessionManager.this + ": Touched sessions: " + sessionIds);
Expand Down Expand Up @@ -860,19 +860,15 @@ protected void doLoad() throws ClassNotFoundException, IOException {
return;
} catch (IOException e) {
getLogger().error("Exception loading sessions", e);
if (fis != null) {
try {
fis.close();
} catch (IOException f) {
// Ignore
}
try {
fis.close();
} catch (IOException f) {
// Ignore
}
if (bis != null) {
try {
bis.close();
} catch (IOException f) {
// Ignore
}
try {
bis.close();
} catch (IOException f) {
// Ignore
}
throw e;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ private void checkRemoteCommand(final String remoteCommand) {
// {cmd}
if (!isSwitch && !isHostOrCmd) {
final String previous =
(array == null || array.isEmpty()) ? null : array.get(array.size() - 1);
array.isEmpty() ? null : array.get(array.size() - 1);
final boolean isValueForSwitch = previous != null && previous.startsWith("-");
final boolean isHostWithUser = string.contains("@") && string.endsWith("{host}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1430,14 +1430,14 @@ private RuntimeException generatePoolOrCacheCancelledException(Throwable e) {
if (cacheCriterion != null) {
return cacheCriterion.generateCancelledException(e);
}
} else {
if (cache == null && dsys != null) {
if (dsys != null) {
cache = dsys.getCache();
if (cache == null) {
throw new IllegalStateException(
"Cache must be created before creating pool");
}
}
} else {
if (cacheCriterion == null || cacheCriterion != cache.getCancelCriterion()) {
cacheCriterion = cache.getCancelCriterion();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ private void checkAllProjectedFieldsInGroupBy(ExecutionContext context)

// check if all the group by fields are present in projected columns
if (this.groupBy != null) {
int numGroupCols = this.groupBy != null ? this.groupBy.size() : 0;
int numGroupCols = this.groupBy.size();
int numColsInProj = this.projAttrs.size();
numColsInProj -= this.aggregateFunctions.length;
if (numGroupCols != numColsInProj) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ private void addToResultsFromEntries(Iterator entriesIter, Collection result,
boolean applyOrderBy, boolean asc, long iteratorCreationTime) throws FunctionDomainException,
TypeMismatchException, NameResolutionException, QueryInvocationTargetException {
QueryObserver observer = QueryObserverHolder.getInstance();
if (result == null || (limit != -1 && result != null && result.size() == limit)) {
if (result == null || limit != -1 && result.size() == limit) {
return;
}
List orderedKeys = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1314,9 +1314,6 @@ public void addHostedLocators(InternalDistributedMember member, Collection<Strin
this.hostedLocatorsAll = tmp;

if (isSharedConfigurationEnabled) {
if (locators == null || locators.isEmpty()) {
throw new IllegalArgumentException("Cannot use empty collection of locators");
}
if (this.hostedLocatorsWithSharedConfiguration.isEmpty()) {
this.hostedLocatorsWithSharedConfiguration = new HashMap<>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,11 @@ private Short getServerVersion(InetSocketAddress ipAddr, int timeout)
"Unrecognisable response received: This could be the result of trying to connect a non-SSL-enabled client to an SSL-enabled locator.");
}
VersionResponse response = (VersionResponse) readObject;
if (response != null) {
serverVersion = Short.valueOf(response.getVersionOrdinal());
synchronized (serverVersions) {
serverVersions.put(ipAddr, serverVersion);
}
return serverVersion;
serverVersion = Short.valueOf(response.getVersionOrdinal());
synchronized (serverVersions) {
serverVersions.put(ipAddr, serverVersion);
}
return serverVersion;
} catch (EOFException ex) {
// old locators will not recognize the version request and will close the connection
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,6 @@ public static PrintStream redirectOutput(File newOutput, boolean setOut) throws
redirectCOutput(newOutput.getPath());
}
}
assert newPrintStream != null;
return newPrintStream;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ protected void callCacheCollector(CacheSnapshot results, InternalDistributedMemb
}
if (collector != null) {
GemFireVM vm = getMemberById(sender);
if (vm != null && collector != null) {
if (vm != null) {
collector.resultsReturned(results, vm, snapshotId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ protected AbstractRegion(InternalCache cache, RegionAttributes attrs, String reg
}

evictionAttributes = new EvictionAttributesImpl(attrs.getEvictionAttributes());
if (attrs.getPartitionAttributes() != null && this.evictionAttributes != null
&& this.evictionAttributes.getAlgorithm().isLRUMemory()
&& attrs.getPartitionAttributes().getLocalMaxMemory() != 0 && this.evictionAttributes
if (attrs.getPartitionAttributes() != null && this.evictionAttributes.getAlgorithm()
.isLRUMemory() && attrs.getPartitionAttributes().getLocalMaxMemory() != 0
&& this.evictionAttributes
.getMaximum() != attrs.getPartitionAttributes().getLocalMaxMemory()) {
logger.warn(
"For region {} with data policy PARTITION, memory LRU eviction attribute maximum has been reset from {}MB to local-max-memory {}MB",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ public void processAndGenerateTXVersionTag(EntryEventImpl callbackEvent, RegionE
// For distributed transactions, stuff the next region version generated
// in phase-1 commit into the callbackEvent so that ARE.generateVersionTag can later
// just apply it and not regenerate it in phase-2 commit
if (callbackEvent != null && txEntryState != null
if (txEntryState != null
&& txEntryState.getDistTxEntryStates() != null) {
callbackEvent.setNextRegionVersion(txEntryState.getDistTxEntryStates().getRegionVersion());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1169,11 +1169,7 @@ public void getLocalFilterRoutingForPutAllOp(DistributedPutAllOperation dpao,
Set clients = null;
int size = putAllData.length;
CqService cqService = getCqService(dpao.getRegion());
boolean doCQs = cqService.isRunning()
&& this.region != null /*
* && !(this.region.isUsedForPartitionedRegionBucket() ||
* (this.region instanceof PartitionedRegion))
*/;
boolean doCQs = cqService.isRunning();
for (int idx = 0; idx < size; idx++) {
PutAllEntryData pEntry = putAllData[idx];
if (pEntry != null) {
Expand Down Expand Up @@ -1228,7 +1224,7 @@ public void getLocalFilterRoutingForRemoveAllOp(DistributedRemoveAllOperation op
Set clients = null;
int size = removeAllData.length;
CqService cqService = getCqService(op.getRegion());
boolean doCQs = cqService.isRunning() && this.region != null;
boolean doCQs = cqService.isRunning();
for (int idx = 0; idx < size; idx++) {
RemoveAllEntryData pEntry = removeAllData[idx];
if (pEntry != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3646,11 +3646,6 @@ private ResultCollector executeOnSingleNode(final Function function,
targetNode = getOrCreateNodeForBucketRead(bucketId);
}
}
if (targetNode == null) {
throw new FunctionException(
String.format("No target node found for KEY, %s",
key));
}
} else {
execution.clearFailedNodes();
}
Expand Down Expand Up @@ -8083,7 +8078,7 @@ private void _getKeysWithInterest(int interestType, Object interestArg, boolean

InternalDistributedMember lastTarget = bucketNode;
bucketNode = getOrCreateNodeForBucketRead(lbucket);
if (lastTarget != null && lastTarget.equals(bucketNode)) {
if (lastTarget.equals(bucketNode)) {
if (retryTime.overMaximum()) {
break;
}
Expand Down Expand Up @@ -8685,7 +8680,7 @@ public int removeIndex(Index ind, boolean remotelyOriginated)

// Check if the returned value is instance of Index (this means the index is
// not in create phase, its created successfully).
if (prIndex == null || !(prIndex instanceof Index)) {
if (!(prIndex instanceof Index)) {
logger.info("This index {} is not on this partitoned region : {}",
ind, this);
return numBuckets;
Expand All @@ -8704,10 +8699,8 @@ public int removeIndex(Index ind, boolean remotelyOriginated)

// After removing from region wait for removing from index manager and
// marking the index invalid.
if (prIndex != null) {
PartitionedIndex index = (PartitionedIndex) prIndex;
index.acquireIndexWriteLockForRemove();
}
PartitionedIndex index = (PartitionedIndex) prIndex;
index.acquireIndexWriteLockForRemove();

this.indexes.remove(indexTask);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ public Set handleRemoteGetKeys(Integer bucketId, int interestType, Object intere
throw new PRLocallyDestroyedException(rde);
} else {
this.getPartitionedRegion().checkReadiness();
if (r != null && r.isBucketDestroyed()) {
if (r.isBucketDestroyed()) {
// bucket moved by rebalance
throw new ForceReattemptException("Bucket removed during remoteGetKeys", rde);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static boolean send(InternalCache cache, Set<InternalDistributedMember> r
filteredRecipients.add(recipient);
}
}
if (filteredRecipients == null || filteredRecipients.size() == 0)
if (filteredRecipients.size() == 0)
return true;

ReplyProcessor21 replyProcessor = new ReplyProcessor21(dm, filteredRecipients);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public void run() {
try {
if (channelState != null) {
if (logger.isTraceEnabled(LogMarker.STATE_FLUSH_OP_VERBOSE)
&& ((channelState != null) && (channelState.size() > 0))) {
&& (channelState.size() > 0)) {
logger.trace(LogMarker.STATE_FLUSH_OP_VERBOSE, "Waiting for channel states: {}",
channelStateDescription(channelState));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ public static Object getValueOnDisk(DiskEntry entry, DiskRegion dr) {
dr.acquireReadLock();
try {
synchronized (id) {
if (id == null || (dr.isBackup() && id.getKeyId() == DiskRegion.INVALID_ID)
|| (!entry.isValueNull() && id.needsToBeWritten()
&& !EntryBits.isRecoveredFromDisk(id.getUserBits()))/* fix for bug 41942 */) {
if (dr.isBackup() && id.getKeyId() == DiskRegion.INVALID_ID || !entry.isValueNull() && id
.needsToBeWritten() && !EntryBits
.isRecoveredFromDisk(id.getUserBits())/* fix for bug 41942 */) {
return null;
}

Expand Down Expand Up @@ -177,7 +177,7 @@ public static Object getSerializedValueOnDisk(DiskEntry entry, DiskRegion dr) {
dr.acquireReadLock();
try {
synchronized (did) {
if (did == null || (dr.isBackup() && did.getKeyId() == DiskRegion.INVALID_ID)) {
if (dr.isBackup() && did.getKeyId() == DiskRegion.INVALID_ID) {
return null;
} else if (!entry.isValueNull() && did.needsToBeWritten()
&& !EntryBits.isRecoveredFromDisk(did.getUserBits())/* fix for bug 41942 */) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,9 @@ public TXLockId txLock(List regionLockReqs, Set txParticipants) throws CommitCon
Thread.currentThread().interrupt();
logger.debug("[TXLockServiceImpl.txLock] was interrupted", e);
if (gotLocks) {
if (txLockId != null) {
synchronized (this.txLockIdList) {
this.txLockIdList.remove(txLockId);
}
synchronized (this.txLockIdList) {
this.txLockIdList.remove(txLockId);
}
gotLocks = false;
}
// TODO: change to be TransactionFailedException (after creating TFE)...
throw new CommitConflictException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ protected void registerGFEClient(DataInputStream dis, DataOutputStream dos, Sock
}

Subject shiroSubject =
subject != null && subject instanceof Subject ? (Subject) subject : null;
subject instanceof Subject ? (Subject) subject : null;
proxy = registerClient(socket, proxyID, proxy, isPrimary, clientConflation, clientVersion,
acceptorId, notifyBySubscription, shiroSubject);

Expand All @@ -354,12 +354,6 @@ protected void registerGFEClient(DataInputStream dis, DataOutputStream dos, Sock

String postAuthzFactoryName = sysProps.getProperty(SECURITY_CLIENT_ACCESSOR_PP);
if (postAuthzFactoryName != null && postAuthzFactoryName.length() > 0) {
if (principal == null) {
securityLogWriter.warning(
String.format(
"CacheClientNotifier: Post process authorization callback enabled but authentication callback (%s) returned with null credentials for proxyID: %s",
new Object[] {SECURITY_CLIENT_AUTHENTICATOR, proxyID}));
}
Method authzMethod = ClassLoadUtil.methodFromName(postAuthzFactoryName);
authzCallback = (AccessControl) authzMethod.invoke(null, (Object[]) null);
authzCallback.init(principal, member, this.getCache());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,7 @@ else if (mirror.equals(MirrorType.KEYS_VALUES))
|| ((RegionAttributesCreation) attrs).hasGatewaySenderId())) {
Set<String> senderIds = new HashSet<String>(attrs.getGatewaySenderIds());
StringBuilder senderStringBuff = new StringBuilder();
if (senderIds != null && senderIds.size() != 0) {
if (senderIds.size() != 0) {
for (String senderId : senderIds) {
if (!(senderStringBuff.length() == 0)) {
senderStringBuff.append(",");
Expand All @@ -2039,7 +2039,7 @@ else if (mirror.equals(MirrorType.KEYS_VALUES))
|| ((RegionAttributesCreation) attrs).hasAsyncEventListeners())) {
Set<String> asyncEventQueueIds = new HashSet<String>(attrs.getAsyncEventQueueIds());
StringBuilder asyncEventQueueStringBuff = new StringBuilder();
if (asyncEventQueueIds != null && asyncEventQueueIds.size() != 0) {
if (asyncEventQueueIds.size() != 0) {
for (String asyncEventQueueId : asyncEventQueueIds) {
if (!(asyncEventQueueStringBuff.length() == 0)) {
asyncEventQueueStringBuff.append(",");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,8 @@ public String toString() {
}

public boolean equals(Object o) {
Object k, u;
Node<?> e;
return ((o instanceof Node) && ((k = (e = (Node<?>) o)) != null)
&& (k == key || k.equals(key)));
return ((o instanceof Node)
&& (o == key || o.equals(key)));
}

/**
Expand Down Expand Up @@ -1711,14 +1709,14 @@ boolean removeTreeNode(TreeNode<K> p) {
else
sp.right = p;
}
if ((s.right = pr) != null)
pr.parent = s;
s.right = pr;
pr.parent = s;
}
p.left = null;
if ((p.right = sr) != null)
sr.parent = p;
if ((s.left = pl) != null)
pl.parent = s;
s.left = pl;
pl.parent = s;
if ((s.parent = pp) == null)
r = s;
else if (p == pp.left)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,9 @@ public boolean isProcessActive(final int processId) {
return false;
} else {
final IntByReference status = new IntByReference();
final boolean result = Kernel32.GetExitCodeProcess(procHandle, status) && status != null
&& status.getValue() == Kernel32.STILL_ACTIVE;
final boolean result =
Kernel32.GetExitCodeProcess(procHandle, status)
&& status.getValue() == Kernel32.STILL_ACTIVE;
Kernel32.CloseHandle(procHandle);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@

import javax.management.Attribute;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanException;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.management.ReflectionException;

import org.apache.logging.log4j.Logger;

Expand Down Expand Up @@ -121,17 +119,11 @@ public void execute(FunctionContext fc) {
if (cache != null && !cache.isClosed()) {
sendException(e, fc);
}
} catch (ReflectionException e) {
sendException(e, fc);
} catch (MBeanException e) {
sendException(e, fc);
} catch (NullPointerException e) {
sendException(e, fc);
} catch (Exception e) {
sendException(e, fc);
} finally {
if (!executedSuccessfully) {
if (cache == null || (cache != null && cache.isClosed())) {
if (cache == null || cache.isClosed()) {
Exception e =
new Exception("Member Is Shutting down");
sendException(e, fc);
Expand Down
Loading