use of org.infinispan.jmx.annotations.ManagedOperation in project infinispan by infinispan.
the class GlobalSecurityManagerImpl method flushGlobalACLCache.
@ManagedOperation(name = "Flush ACL Cache", displayName = "Flush ACL Cache", description = "Flushes the global ACL cache across the entire cluster")
@Override
public CompletionStage<Void> flushGlobalACLCache() {
if (cacheEnabled) {
ClusterExecutor executor = SecurityActions.getClusterExecutor(embeddedCacheManager);
return executor.submitConsumer(cm -> {
GlobalSecurityManager globalSecurityManager = SecurityActions.getGlobalComponentRegistry(cm).getComponent(GlobalSecurityManager.class);
((GlobalSecurityManagerImpl) globalSecurityManager).flushGlobalACLCache0();
return null;
}, (a, v, t) -> {
});
} else {
return CompletableFutures.completedNull();
}
}
use of org.infinispan.jmx.annotations.ManagedOperation in project infinispan by infinispan.
the class DistributionManagerImpl method isAffectedByRehash.
@Override
@ManagedOperation(description = "Determines whether a given key is affected by an ongoing rehash, if any.", displayName = "Could key be affected by rehash?")
public boolean isAffectedByRehash(@Parameter(name = "key", description = "Key to check") Object key) {
if (!isRehashInProgress())
return false;
int segment = keyPartitioner.getSegment(key);
DistributionInfo distributionInfo = this.extendedTopology.getDistribution(segment);
return distributionInfo.isWriteOwner() && !distributionInfo.isReadOwner();
}
use of org.infinispan.jmx.annotations.ManagedOperation in project infinispan by infinispan.
the class ExtendedStatisticInterceptor method dumpStatisticToFile.
@ManagedOperation(description = "Dumps the current cache statistic values to a file", displayName = "Dump cache Statistics to file")
public final void dumpStatisticToFile(@Parameter(description = "The file path") String filePath) throws IOException {
PrintStream stream = null;
try {
stream = new PrintStream(new File(filePath));
cacheStatisticManager.dumpCacheStatisticsTo(stream);
} finally {
if (stream != null) {
stream.close();
}
}
}
use of org.infinispan.jmx.annotations.ManagedOperation in project infinispan by infinispan.
the class EmbeddedClusteredLockManager method removeSync.
@ManagedOperation(description = "Removes the lock from the cluster. The lock has to be recreated to access next time.", displayName = "Remove Clustered Lock", name = REMOVE)
public boolean removeSync(String name) {
if (log.isTraceEnabled())
log.tracef("LOCK[%s] remove sync has been called", name);
ClusteredLockImpl clusteredLock = (ClusteredLockImpl) locks.get(name);
if (clusteredLock != null) {
clusteredLock.stop();
locks.remove(name);
}
return cache().remove(new ClusteredLockKey(ByteString.fromString(name))) != null;
}
use of org.infinispan.jmx.annotations.ManagedOperation in project infinispan by infinispan.
the class XSiteAdminOperations method bringSiteOnline.
@ManagedOperation(description = "Brings the given site back online on all the cluster.", displayName = "Brings the given site back online on all the cluster.")
public String bringSiteOnline(@Parameter(name = "site", description = "The name of the backup site") String site) {
authorizer.checkPermission(AuthorizationPermission.ADMIN);
BringSiteOnlineResponse rsp = takeOfflineManager.bringSiteOnline(site);
if (rsp == BringSiteOnlineResponse.NO_SUCH_SITE) {
return incorrectSiteName(site);
}
CacheRpcCommand command = commandsFactory.buildXSiteBringOnlineCommand(site);
XSiteResponse<Void> response = invokeOnAll(command, new VoidResponseCollector(clusterSize()));
return returnFailureOrSuccess(response.getErrors(), "Could not take the site online on nodes:");
}
Aggregations