id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
29,700
infinispan/infinispan
core/src/main/java/org/infinispan/statetransfer/StateConsumerImpl.java
StateConsumerImpl.stopApplyingState
@Override public void stopApplyingState(int topologyId) { if (trace) log.tracef("Stop keeping track of changed keys for state transfer in topology %d", topologyId); commitManager.stopTrack(PUT_FOR_STATE_TRANSFER); }
java
@Override public void stopApplyingState(int topologyId) { if (trace) log.tracef("Stop keeping track of changed keys for state transfer in topology %d", topologyId); commitManager.stopTrack(PUT_FOR_STATE_TRANSFER); }
[ "@", "Override", "public", "void", "stopApplyingState", "(", "int", "topologyId", ")", "{", "if", "(", "trace", ")", "log", ".", "tracef", "(", "\"Stop keeping track of changed keys for state transfer in topology %d\"", ",", "topologyId", ")", ";", "commitManager", "....
Stops applying incoming state. Also stops tracking updated keys. Should be called at the end of state transfer or when a ClearCommand is committed during state transfer.
[ "Stops", "applying", "incoming", "state", ".", "Also", "stops", "tracking", "updated", "keys", ".", "Should", "be", "called", "at", "the", "end", "of", "state", "transfer", "or", "when", "a", "ClearCommand", "is", "committed", "during", "state", "transfer", ...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/statetransfer/StateConsumerImpl.java#L206-L210
29,701
infinispan/infinispan
core/src/main/java/org/infinispan/statetransfer/StateConsumerImpl.java
StateConsumerImpl.start
@Start(priority = 20) public void start() { cacheName = cache.wired().getName(); isInvalidationMode = configuration.clustering().cacheMode().isInvalidation(); isTransactional = configuration.transaction().transactionMode().isTransactional(); isTotalOrder = configuration.transaction().transactionProtocol().isTotalOrder(); timeout = configuration.clustering().stateTransfer().timeout(); CacheMode mode = configuration.clustering().cacheMode(); isFetchEnabled = mode.needsStateTransfer() && (configuration.clustering().stateTransfer().fetchInMemoryState() || configuration.persistence().fetchPersistentState()); rpcOptions = new RpcOptions(DeliverOrder.NONE, timeout, TimeUnit.MILLISECONDS); stateRequestExecutor = new LimitedExecutor("StateRequest-" + cacheName, stateTransferExecutor, 1); running = true; }
java
@Start(priority = 20) public void start() { cacheName = cache.wired().getName(); isInvalidationMode = configuration.clustering().cacheMode().isInvalidation(); isTransactional = configuration.transaction().transactionMode().isTransactional(); isTotalOrder = configuration.transaction().transactionProtocol().isTotalOrder(); timeout = configuration.clustering().stateTransfer().timeout(); CacheMode mode = configuration.clustering().cacheMode(); isFetchEnabled = mode.needsStateTransfer() && (configuration.clustering().stateTransfer().fetchInMemoryState() || configuration.persistence().fetchPersistentState()); rpcOptions = new RpcOptions(DeliverOrder.NONE, timeout, TimeUnit.MILLISECONDS); stateRequestExecutor = new LimitedExecutor("StateRequest-" + cacheName, stateTransferExecutor, 1); running = true; }
[ "@", "Start", "(", "priority", "=", "20", ")", "public", "void", "start", "(", ")", "{", "cacheName", "=", "cache", ".", "wired", "(", ")", ".", "getName", "(", ")", ";", "isInvalidationMode", "=", "configuration", ".", "clustering", "(", ")", ".", "...
Must run after the PersistenceManager
[ "Must", "run", "after", "the", "PersistenceManager" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/statetransfer/StateConsumerImpl.java#L721-L737
29,702
infinispan/infinispan
core/src/main/java/org/infinispan/statetransfer/StateConsumerImpl.java
StateConsumerImpl.cancelTransfers
protected void cancelTransfers(IntSet removedSegments) { synchronized (transferMapsLock) { List<Integer> segmentsToCancel = new ArrayList<>(removedSegments); while (!segmentsToCancel.isEmpty()) { int segmentId = segmentsToCancel.remove(0); List<InboundTransferTask> inboundTransfers = transfersBySegment.get(segmentId); if (inboundTransfers != null) { // we need to check the transfer was not already completed for (InboundTransferTask inboundTransfer : inboundTransfers) { IntSet cancelledSegments = IntSets.mutableCopyFrom(removedSegments); cancelledSegments.retainAll(inboundTransfer.getSegments()); segmentsToCancel.removeAll(cancelledSegments); transfersBySegment.keySet().removeAll(cancelledSegments); //this will also remove it from transfersBySource if the entire task gets cancelled inboundTransfer.cancelSegments(cancelledSegments); if (inboundTransfer.isCancelled()) { removeTransfer(inboundTransfer); } } } } } }
java
protected void cancelTransfers(IntSet removedSegments) { synchronized (transferMapsLock) { List<Integer> segmentsToCancel = new ArrayList<>(removedSegments); while (!segmentsToCancel.isEmpty()) { int segmentId = segmentsToCancel.remove(0); List<InboundTransferTask> inboundTransfers = transfersBySegment.get(segmentId); if (inboundTransfers != null) { // we need to check the transfer was not already completed for (InboundTransferTask inboundTransfer : inboundTransfers) { IntSet cancelledSegments = IntSets.mutableCopyFrom(removedSegments); cancelledSegments.retainAll(inboundTransfer.getSegments()); segmentsToCancel.removeAll(cancelledSegments); transfersBySegment.keySet().removeAll(cancelledSegments); //this will also remove it from transfersBySource if the entire task gets cancelled inboundTransfer.cancelSegments(cancelledSegments); if (inboundTransfer.isCancelled()) { removeTransfer(inboundTransfer); } } } } } }
[ "protected", "void", "cancelTransfers", "(", "IntSet", "removedSegments", ")", "{", "synchronized", "(", "transferMapsLock", ")", "{", "List", "<", "Integer", ">", "segmentsToCancel", "=", "new", "ArrayList", "<>", "(", "removedSegments", ")", ";", "while", "(",...
Cancel transfers for segments we no longer own. @param removedSegments segments to be cancelled
[ "Cancel", "transfers", "for", "segments", "we", "no", "longer", "own", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/statetransfer/StateConsumerImpl.java#L953-L974
29,703
infinispan/infinispan
core/src/main/java/org/infinispan/statetransfer/StateConsumerImpl.java
StateConsumerImpl.restartBrokenTransfers
private void restartBrokenTransfers(CacheTopology cacheTopology, IntSet addedSegments) { Set<Address> members = new HashSet<>(cacheTopology.getReadConsistentHash().getMembers()); synchronized (transferMapsLock) { for (Iterator<Map.Entry<Address, List<InboundTransferTask>>> it = transfersBySource.entrySet().iterator(); it.hasNext(); ) { Map.Entry<Address, List<InboundTransferTask>> entry = it.next(); Address source = entry.getKey(); if (!members.contains(source)) { if (trace) { log.tracef("Removing inbound transfers from source %s for cache %s", source, cacheName); } List<InboundTransferTask> inboundTransfers = entry.getValue(); it.remove(); for (InboundTransferTask inboundTransfer : inboundTransfers) { // these segments will be restarted if they are still in new write CH if (trace) { log.tracef("Removing inbound transfers from node %s for segments %s", source, inboundTransfer.getSegments()); } IntSet unfinishedSegments = inboundTransfer.getUnfinishedSegments(); inboundTransfer.cancel(); addedSegments.addAll(unfinishedSegments); transfersBySegment.keySet().removeAll(unfinishedSegments); } } } // exclude those that are already in progress from a valid source addedSegments.removeAll(transfersBySegment.keySet()); } }
java
private void restartBrokenTransfers(CacheTopology cacheTopology, IntSet addedSegments) { Set<Address> members = new HashSet<>(cacheTopology.getReadConsistentHash().getMembers()); synchronized (transferMapsLock) { for (Iterator<Map.Entry<Address, List<InboundTransferTask>>> it = transfersBySource.entrySet().iterator(); it.hasNext(); ) { Map.Entry<Address, List<InboundTransferTask>> entry = it.next(); Address source = entry.getKey(); if (!members.contains(source)) { if (trace) { log.tracef("Removing inbound transfers from source %s for cache %s", source, cacheName); } List<InboundTransferTask> inboundTransfers = entry.getValue(); it.remove(); for (InboundTransferTask inboundTransfer : inboundTransfers) { // these segments will be restarted if they are still in new write CH if (trace) { log.tracef("Removing inbound transfers from node %s for segments %s", source, inboundTransfer.getSegments()); } IntSet unfinishedSegments = inboundTransfer.getUnfinishedSegments(); inboundTransfer.cancel(); addedSegments.addAll(unfinishedSegments); transfersBySegment.keySet().removeAll(unfinishedSegments); } } } // exclude those that are already in progress from a valid source addedSegments.removeAll(transfersBySegment.keySet()); } }
[ "private", "void", "restartBrokenTransfers", "(", "CacheTopology", "cacheTopology", ",", "IntSet", "addedSegments", ")", "{", "Set", "<", "Address", ">", "members", "=", "new", "HashSet", "<>", "(", "cacheTopology", ".", "getReadConsistentHash", "(", ")", ".", "...
Check if any of the existing transfers should be restarted from a different source because the initial source is no longer a member.
[ "Check", "if", "any", "of", "the", "existing", "transfers", "should", "be", "restarted", "from", "a", "different", "source", "because", "the", "initial", "source", "is", "no", "longer", "a", "member", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/statetransfer/StateConsumerImpl.java#L1038-L1066
29,704
infinispan/infinispan
core/src/main/java/org/infinispan/interceptors/locking/AbstractLockingInterceptor.java
AbstractLockingInterceptor.visitNonTxDataWriteCommand
final Object visitNonTxDataWriteCommand(InvocationContext ctx, DataWriteCommand command) { if (hasSkipLocking(command) || !shouldLockKey(command)) { return invokeNext(ctx, command); } LockPromise lockPromise = lockAndRecord(ctx, command.getKey(), getLockTimeoutMillis(command)); return nonTxLockAndInvokeNext(ctx, command, lockPromise, unlockAllReturnHandler); }
java
final Object visitNonTxDataWriteCommand(InvocationContext ctx, DataWriteCommand command) { if (hasSkipLocking(command) || !shouldLockKey(command)) { return invokeNext(ctx, command); } LockPromise lockPromise = lockAndRecord(ctx, command.getKey(), getLockTimeoutMillis(command)); return nonTxLockAndInvokeNext(ctx, command, lockPromise, unlockAllReturnHandler); }
[ "final", "Object", "visitNonTxDataWriteCommand", "(", "InvocationContext", "ctx", ",", "DataWriteCommand", "command", ")", "{", "if", "(", "hasSkipLocking", "(", "command", ")", "||", "!", "shouldLockKey", "(", "command", ")", ")", "{", "return", "invokeNext", "...
We need this method in here because of putForExternalRead
[ "We", "need", "this", "method", "in", "here", "because", "of", "putForExternalRead" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/interceptors/locking/AbstractLockingInterceptor.java#L120-L127
29,705
infinispan/infinispan
core/src/main/java/org/infinispan/interceptors/locking/AbstractLockingInterceptor.java
AbstractLockingInterceptor.nonTxLockAndInvokeNext
protected final Object nonTxLockAndInvokeNext(InvocationContext ctx, VisitableCommand command, LockPromise lockPromise, InvocationFinallyAction finallyFunction) { return lockPromise.toInvocationStage().andHandle(ctx, command, (rCtx, rCommand, rv, throwable) -> { if (throwable != null) { lockManager.unlockAll(rCtx); throw throwable; } else { return invokeNextAndFinally(rCtx, rCommand, finallyFunction); } }); }
java
protected final Object nonTxLockAndInvokeNext(InvocationContext ctx, VisitableCommand command, LockPromise lockPromise, InvocationFinallyAction finallyFunction) { return lockPromise.toInvocationStage().andHandle(ctx, command, (rCtx, rCommand, rv, throwable) -> { if (throwable != null) { lockManager.unlockAll(rCtx); throw throwable; } else { return invokeNextAndFinally(rCtx, rCommand, finallyFunction); } }); }
[ "protected", "final", "Object", "nonTxLockAndInvokeNext", "(", "InvocationContext", "ctx", ",", "VisitableCommand", "command", ",", "LockPromise", "lockPromise", ",", "InvocationFinallyAction", "finallyFunction", ")", "{", "return", "lockPromise", ".", "toInvocationStage", ...
Locks and invoke the next interceptor for non-transactional commands.
[ "Locks", "and", "invoke", "the", "next", "interceptor", "for", "non", "-", "transactional", "commands", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/interceptors/locking/AbstractLockingInterceptor.java#L292-L302
29,706
infinispan/infinispan
hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/InvalidationCacheAccessDelegate.java
InvalidationCacheAccessDelegate.get
@Override @SuppressWarnings("UnusedParameters") public Object get(Object session, Object key, long txTimestamp) throws CacheException { if ( !region.checkValid() ) { return null; } final Object val = cache.get( key ); if (val == null && session != null) { putValidator.registerPendingPut(session, key, txTimestamp ); } return val; }
java
@Override @SuppressWarnings("UnusedParameters") public Object get(Object session, Object key, long txTimestamp) throws CacheException { if ( !region.checkValid() ) { return null; } final Object val = cache.get( key ); if (val == null && session != null) { putValidator.registerPendingPut(session, key, txTimestamp ); } return val; }
[ "@", "Override", "@", "SuppressWarnings", "(", "\"UnusedParameters\"", ")", "public", "Object", "get", "(", "Object", "session", ",", "Object", "key", ",", "long", "txTimestamp", ")", "throws", "CacheException", "{", "if", "(", "!", "region", ".", "checkValid"...
Attempt to retrieve an object from the cache. @param session @param key The key of the item to be retrieved @param txTimestamp a timestamp prior to the transaction start time @return the cached object or <tt>null</tt> @throws CacheException if the cache retrieval failed
[ "Attempt", "to", "retrieve", "an", "object", "from", "the", "cache", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/InvalidationCacheAccessDelegate.java#L54-L65
29,707
infinispan/infinispan
hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/InvalidationCacheAccessDelegate.java
InvalidationCacheAccessDelegate.putFromLoad
@Override @SuppressWarnings("UnusedParameters") public boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException { if ( !region.checkValid() ) { if (trace) { log.tracef( "Region %s not valid", region.getName() ); } return false; } // In theory, since putForExternalRead is already as minimal as it can // get, we shouldn't be need this check. However, without the check and // without https://issues.jboss.org/browse/ISPN-1986, it's impossible to // know whether the put actually occurred. Knowing this is crucial so // that Hibernate can expose accurate statistics. if ( minimalPutOverride && cache.containsKey( key ) ) { return false; } PutFromLoadValidator.Lock lock = putValidator.acquirePutFromLoadLock(session, key, txTimestamp); if ( lock == null) { if (trace) { log.tracef( "Put from load lock not acquired for key %s", key ); } return false; } try { writeCache.putForExternalRead( key, value ); } finally { putValidator.releasePutFromLoadLock( key, lock); } return true; }
java
@Override @SuppressWarnings("UnusedParameters") public boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException { if ( !region.checkValid() ) { if (trace) { log.tracef( "Region %s not valid", region.getName() ); } return false; } // In theory, since putForExternalRead is already as minimal as it can // get, we shouldn't be need this check. However, without the check and // without https://issues.jboss.org/browse/ISPN-1986, it's impossible to // know whether the put actually occurred. Knowing this is crucial so // that Hibernate can expose accurate statistics. if ( minimalPutOverride && cache.containsKey( key ) ) { return false; } PutFromLoadValidator.Lock lock = putValidator.acquirePutFromLoadLock(session, key, txTimestamp); if ( lock == null) { if (trace) { log.tracef( "Put from load lock not acquired for key %s", key ); } return false; } try { writeCache.putForExternalRead( key, value ); } finally { putValidator.releasePutFromLoadLock( key, lock); } return true; }
[ "@", "Override", "@", "SuppressWarnings", "(", "\"UnusedParameters\"", ")", "public", "boolean", "putFromLoad", "(", "Object", "session", ",", "Object", "key", ",", "Object", "value", ",", "long", "txTimestamp", ",", "Object", "version", ",", "boolean", "minimal...
Attempt to cache an object, after loading from the database, explicitly specifying the minimalPut behavior. @param session Current session @param key The item key @param value The item @param txTimestamp a timestamp prior to the transaction start time @param version the item version number @param minimalPutOverride Explicit minimalPut flag @return <tt>true</tt> if the object was successfully cached @throws CacheException if storing the object failed
[ "Attempt", "to", "cache", "an", "object", "after", "loading", "from", "the", "database", "explicitly", "specifying", "the", "minimalPut", "behavior", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/InvalidationCacheAccessDelegate.java#L85-L121
29,708
infinispan/infinispan
core/src/main/java/org/infinispan/cache/impl/SimpleCacheImpl.java
SimpleCacheImpl.isNull
private boolean isNull(InternalCacheEntry<K, V> entry) { if (entry == null) { return true; } else if (entry.canExpire()) { if (entry.isExpired(timeService.wallClockTime())) { if (cacheNotifier.hasListener(CacheEntryExpired.class)) { CompletionStages.join(cacheNotifier.notifyCacheEntryExpired(entry.getKey(), entry.getValue(), entry.getMetadata(), ImmutableContext.INSTANCE)); } return true; } } return false; }
java
private boolean isNull(InternalCacheEntry<K, V> entry) { if (entry == null) { return true; } else if (entry.canExpire()) { if (entry.isExpired(timeService.wallClockTime())) { if (cacheNotifier.hasListener(CacheEntryExpired.class)) { CompletionStages.join(cacheNotifier.notifyCacheEntryExpired(entry.getKey(), entry.getValue(), entry.getMetadata(), ImmutableContext.INSTANCE)); } return true; } } return false; }
[ "private", "boolean", "isNull", "(", "InternalCacheEntry", "<", "K", ",", "V", ">", "entry", ")", "{", "if", "(", "entry", "==", "null", ")", "{", "return", "true", ";", "}", "else", "if", "(", "entry", ".", "canExpire", "(", ")", ")", "{", "if", ...
as we'll replace the old value when it's expired
[ "as", "we", "ll", "replace", "the", "old", "value", "when", "it", "s", "expired" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/cache/impl/SimpleCacheImpl.java#L1600-L1613
29,709
infinispan/infinispan
core/src/main/java/org/infinispan/cache/impl/SimpleCacheImpl.java
SimpleCacheImpl.cacheStreamCast
private static <K, V> CacheStream<Entry<K, V>> cacheStreamCast(CacheStream stream) { return stream; }
java
private static <K, V> CacheStream<Entry<K, V>> cacheStreamCast(CacheStream stream) { return stream; }
[ "private", "static", "<", "K", ",", "V", ">", "CacheStream", "<", "Entry", "<", "K", ",", "V", ">", ">", "cacheStreamCast", "(", "CacheStream", "stream", ")", "{", "return", "stream", ";", "}" ]
This is a hack to allow the cast to work. Java doesn't like subtypes in generics
[ "This", "is", "a", "hack", "to", "allow", "the", "cast", "to", "work", ".", "Java", "doesn", "t", "like", "subtypes", "in", "generics" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/cache/impl/SimpleCacheImpl.java#L1820-L1822
29,710
infinispan/infinispan
plugins/protocol-parser-generator-maven-plugin/src/main/java/org/infinispan/ppg/generator/Machine.java
Machine.contractStates
public void contractStates() { boolean contracted; do { contracted = false; for (Iterator<State> iterator = states.iterator(); iterator.hasNext(); ) { State s = iterator.next(); if (s.links.size() == 1 && s.links.get(0).type == LinkType.BACKTRACK) { Link l = s.links.get(0); boolean contractedNow = false; for (State s2 : states) { for (Link l2 : s2.links) { if (l2.next == s && l2.type != LinkType.SENTINEL) { l2.code = l2.code + "\n" + l.code; l2.next = l.next; contractedNow = true; } } } if (contractedNow) { iterator.remove(); contracted = true; } } } } while (contracted); // renumber for (int i = 0; i < states.size(); ++i) { states.get(i).id = i; } }
java
public void contractStates() { boolean contracted; do { contracted = false; for (Iterator<State> iterator = states.iterator(); iterator.hasNext(); ) { State s = iterator.next(); if (s.links.size() == 1 && s.links.get(0).type == LinkType.BACKTRACK) { Link l = s.links.get(0); boolean contractedNow = false; for (State s2 : states) { for (Link l2 : s2.links) { if (l2.next == s && l2.type != LinkType.SENTINEL) { l2.code = l2.code + "\n" + l.code; l2.next = l.next; contractedNow = true; } } } if (contractedNow) { iterator.remove(); contracted = true; } } } } while (contracted); // renumber for (int i = 0; i < states.size(); ++i) { states.get(i).id = i; } }
[ "public", "void", "contractStates", "(", ")", "{", "boolean", "contracted", ";", "do", "{", "contracted", "=", "false", ";", "for", "(", "Iterator", "<", "State", ">", "iterator", "=", "states", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext",...
Try to inline all states that contain only action and state shift.
[ "Try", "to", "inline", "all", "states", "that", "contain", "only", "action", "and", "state", "shift", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/plugins/protocol-parser-generator-maven-plugin/src/main/java/org/infinispan/ppg/generator/Machine.java#L222-L251
29,711
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/jmx/JmxUtil.java
JmxUtil.buildJmxDomain
public static String buildJmxDomain(String domain, MBeanServer mBeanServer, String groupName) { return findJmxDomain(domain, mBeanServer, groupName); }
java
public static String buildJmxDomain(String domain, MBeanServer mBeanServer, String groupName) { return findJmxDomain(domain, mBeanServer, groupName); }
[ "public", "static", "String", "buildJmxDomain", "(", "String", "domain", ",", "MBeanServer", "mBeanServer", ",", "String", "groupName", ")", "{", "return", "findJmxDomain", "(", "domain", ",", "mBeanServer", ",", "groupName", ")", ";", "}" ]
Build the JMX domain name. @param domain The JMX domain name @param mBeanServer the {@link MBeanServer} where to check whether the JMX domain is allowed or not. @param groupName String containing the group name for the JMX MBean @return A string that combines the allowed JMX domain and the group name
[ "Build", "the", "JMX", "domain", "name", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/jmx/JmxUtil.java#L47-L49
29,712
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/jmx/JmxUtil.java
JmxUtil.registerMBean
public static void registerMBean(Object mbean, ObjectName objectName, MBeanServer mBeanServer) throws Exception { if (!mBeanServer.isRegistered(objectName)) { try { SecurityActions.registerMBean(mbean, objectName, mBeanServer); log.tracef("Registered %s under %s", mbean, objectName); } catch (InstanceAlreadyExistsException e) { //this might happen if multiple instances are trying to concurrently register same objectName log.couldNotRegisterObjectName(objectName, e); } } else { log.debugf("Object name %s already registered", objectName); } }
java
public static void registerMBean(Object mbean, ObjectName objectName, MBeanServer mBeanServer) throws Exception { if (!mBeanServer.isRegistered(objectName)) { try { SecurityActions.registerMBean(mbean, objectName, mBeanServer); log.tracef("Registered %s under %s", mbean, objectName); } catch (InstanceAlreadyExistsException e) { //this might happen if multiple instances are trying to concurrently register same objectName log.couldNotRegisterObjectName(objectName, e); } } else { log.debugf("Object name %s already registered", objectName); } }
[ "public", "static", "void", "registerMBean", "(", "Object", "mbean", ",", "ObjectName", "objectName", ",", "MBeanServer", "mBeanServer", ")", "throws", "Exception", "{", "if", "(", "!", "mBeanServer", ".", "isRegistered", "(", "objectName", ")", ")", "{", "try...
Register the given dynamic JMX MBean. @param mbean Dynamic MBean to register @param objectName {@link ObjectName} under which to register the MBean. @param mBeanServer {@link MBeanServer} where to store the MBean. @throws Exception If registration could not be completed.
[ "Register", "the", "given", "dynamic", "JMX", "MBean", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/jmx/JmxUtil.java#L59-L71
29,713
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/jmx/JmxUtil.java
JmxUtil.unregisterMBeans
public static int unregisterMBeans(String filter, MBeanServer mBeanServer) { try { ObjectName filterObjName = new ObjectName(filter); Set<ObjectInstance> mbeans = mBeanServer.queryMBeans(filterObjName, null); for (ObjectInstance mbean : mbeans) { ObjectName name = mbean.getObjectName(); if (trace) log.trace("Unregistering mbean with name: " + name); SecurityActions.unregisterMBean(name, mBeanServer); } return mbeans.size(); } catch (Exception e) { throw new CacheException( "Unable to register mbeans with filter=" + filter, e); } }
java
public static int unregisterMBeans(String filter, MBeanServer mBeanServer) { try { ObjectName filterObjName = new ObjectName(filter); Set<ObjectInstance> mbeans = mBeanServer.queryMBeans(filterObjName, null); for (ObjectInstance mbean : mbeans) { ObjectName name = mbean.getObjectName(); if (trace) log.trace("Unregistering mbean with name: " + name); SecurityActions.unregisterMBean(name, mBeanServer); } return mbeans.size(); } catch (Exception e) { throw new CacheException( "Unable to register mbeans with filter=" + filter, e); } }
[ "public", "static", "int", "unregisterMBeans", "(", "String", "filter", ",", "MBeanServer", "mBeanServer", ")", "{", "try", "{", "ObjectName", "filterObjName", "=", "new", "ObjectName", "(", "filter", ")", ";", "Set", "<", "ObjectInstance", ">", "mbeans", "=",...
Unregister all mbeans whose object names match a given filter. @param filter ObjectName-style formatted filter @param mBeanServer mbean server from which to unregister mbeans @return number of mbeans unregistered
[ "Unregister", "all", "mbeans", "whose", "object", "names", "match", "a", "given", "filter", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/jmx/JmxUtil.java#L94-L110
29,714
infinispan/infinispan
query/src/main/java/org/infinispan/query/impl/LifecycleManager.java
LifecycleManager.cacheStarting
@Override public void cacheStarting(ComponentRegistry cr, Configuration cfg, String cacheName) { InternalCacheRegistry icr = cr.getGlobalComponentRegistry().getComponent(InternalCacheRegistry.class); if (!icr.isInternalCache(cacheName) || icr.internalCacheHasFlag(cacheName, Flag.QUERYABLE)) { AdvancedCache<?, ?> cache = cr.getComponent(Cache.class).getAdvancedCache(); ClassLoader aggregatedClassLoader = makeAggregatedClassLoader(cr.getGlobalComponentRegistry().getGlobalConfiguration().classLoader()); SearchIntegrator searchFactory = null; boolean isIndexed = cfg.indexing().index().isEnabled(); if (isIndexed) { setBooleanQueryMaxClauseCount(); cr.registerComponent(new ShardAllocationManagerImpl(), ShardAllocatorManager.class); searchFactory = createSearchIntegrator(cfg.indexing(), cr, aggregatedClassLoader); KeyTransformationHandler keyTransformationHandler = new KeyTransformationHandler(aggregatedClassLoader); cr.registerComponent(keyTransformationHandler, KeyTransformationHandler.class); createQueryInterceptorIfNeeded(cr.getComponent(BasicComponentRegistry.class), cfg, cache, searchFactory, keyTransformationHandler); addCacheDependencyIfNeeded(cacheName, cache.getCacheManager(), cfg.indexing()); cr.registerComponent(new QueryBox(), QueryBox.class); } registerMatcher(cr, searchFactory, aggregatedClassLoader); cr.registerComponent(new EmbeddedQueryEngine(cache, isIndexed), EmbeddedQueryEngine.class); } }
java
@Override public void cacheStarting(ComponentRegistry cr, Configuration cfg, String cacheName) { InternalCacheRegistry icr = cr.getGlobalComponentRegistry().getComponent(InternalCacheRegistry.class); if (!icr.isInternalCache(cacheName) || icr.internalCacheHasFlag(cacheName, Flag.QUERYABLE)) { AdvancedCache<?, ?> cache = cr.getComponent(Cache.class).getAdvancedCache(); ClassLoader aggregatedClassLoader = makeAggregatedClassLoader(cr.getGlobalComponentRegistry().getGlobalConfiguration().classLoader()); SearchIntegrator searchFactory = null; boolean isIndexed = cfg.indexing().index().isEnabled(); if (isIndexed) { setBooleanQueryMaxClauseCount(); cr.registerComponent(new ShardAllocationManagerImpl(), ShardAllocatorManager.class); searchFactory = createSearchIntegrator(cfg.indexing(), cr, aggregatedClassLoader); KeyTransformationHandler keyTransformationHandler = new KeyTransformationHandler(aggregatedClassLoader); cr.registerComponent(keyTransformationHandler, KeyTransformationHandler.class); createQueryInterceptorIfNeeded(cr.getComponent(BasicComponentRegistry.class), cfg, cache, searchFactory, keyTransformationHandler); addCacheDependencyIfNeeded(cacheName, cache.getCacheManager(), cfg.indexing()); cr.registerComponent(new QueryBox(), QueryBox.class); } registerMatcher(cr, searchFactory, aggregatedClassLoader); cr.registerComponent(new EmbeddedQueryEngine(cache, isIndexed), EmbeddedQueryEngine.class); } }
[ "@", "Override", "public", "void", "cacheStarting", "(", "ComponentRegistry", "cr", ",", "Configuration", "cfg", ",", "String", "cacheName", ")", "{", "InternalCacheRegistry", "icr", "=", "cr", ".", "getGlobalComponentRegistry", "(", ")", ".", "getComponent", "(",...
Registers the Search interceptor in the cache before it gets started
[ "Registers", "the", "Search", "interceptor", "in", "the", "cache", "before", "it", "gets", "started" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/impl/LifecycleManager.java#L126-L153
29,715
infinispan/infinispan
query/src/main/java/org/infinispan/query/impl/LifecycleManager.java
LifecycleManager.checkIndexableClasses
private void checkIndexableClasses(SearchIntegrator searchFactory, Set<Class<?>> indexedEntities) { for (Class<?> c : indexedEntities) { if (searchFactory.getIndexBinding(new PojoIndexedTypeIdentifier(c)) == null) { throw log.classNotIndexable(c.getName()); } } }
java
private void checkIndexableClasses(SearchIntegrator searchFactory, Set<Class<?>> indexedEntities) { for (Class<?> c : indexedEntities) { if (searchFactory.getIndexBinding(new PojoIndexedTypeIdentifier(c)) == null) { throw log.classNotIndexable(c.getName()); } } }
[ "private", "void", "checkIndexableClasses", "(", "SearchIntegrator", "searchFactory", ",", "Set", "<", "Class", "<", "?", ">", ">", "indexedEntities", ")", "{", "for", "(", "Class", "<", "?", ">", "c", ":", "indexedEntities", ")", "{", "if", "(", "searchFa...
Check that the indexable classes declared by the user are really indexable.
[ "Check", "that", "the", "indexable", "classes", "declared", "by", "the", "user", "are", "really", "indexable", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/impl/LifecycleManager.java#L269-L275
29,716
infinispan/infinispan
query/src/main/java/org/infinispan/query/impl/LifecycleManager.java
LifecycleManager.registerQueryMBeans
private void registerQueryMBeans(ComponentRegistry cr, Configuration cfg, SearchIntegrator searchIntegrator) { AdvancedCache<?, ?> cache = cr.getComponent(Cache.class).getAdvancedCache(); // Resolve MBean server instance GlobalJmxStatisticsConfiguration jmxConfig = cr.getGlobalComponentRegistry().getGlobalConfiguration().globalJmxStatistics(); if (!jmxConfig.enabled()) return; if (mbeanServer == null) { mbeanServer = JmxUtil.lookupMBeanServer(jmxConfig.mbeanServerLookup(), jmxConfig.properties()); } // Resolve jmx domain to use for query MBeans String queryGroupName = getQueryGroupName(jmxConfig.cacheManagerName(), cache.getName()); String jmxDomain = JmxUtil.buildJmxDomain(jmxConfig.domain(), mbeanServer, queryGroupName); // Register query statistics MBean, but only enable it if Infinispan config says so try { ObjectName statsObjName = new ObjectName(jmxDomain + ":" + queryGroupName + ",component=Statistics"); InfinispanQueryStatisticsInfo stats = new InfinispanQueryStatisticsInfo(searchIntegrator, statsObjName); stats.setStatisticsEnabled(cfg.jmxStatistics().enabled()); JmxUtil.registerMBean(stats, statsObjName, mbeanServer); cr.registerComponent(stats, InfinispanQueryStatisticsInfo.class); } catch (Exception e) { throw new CacheException("Unable to register query statistics MBean", e); } // Register mass indexer MBean, picking metadata from repo ManageableComponentMetadata massIndexerCompMetadata = cr.getGlobalComponentRegistry().getComponentMetadataRepo() .findComponentMetadata(MassIndexer.class) .toManageableComponentMetadata(); try { KeyTransformationHandler keyTransformationHandler = ComponentRegistryUtils.getKeyTransformationHandler(cache); TimeService timeService = ComponentRegistryUtils.getTimeService(cache); // TODO: MassIndexer should be some kind of query cache component? DistributedExecutorMassIndexer massIndexer = new DistributedExecutorMassIndexer(cache, searchIntegrator, keyTransformationHandler, timeService); ResourceDMBean mbean = new ResourceDMBean(massIndexer, massIndexerCompMetadata); ObjectName massIndexerObjName = new ObjectName(jmxDomain + ":" + queryGroupName + ",component=" + massIndexerCompMetadata.getJmxObjectName()); JmxUtil.registerMBean(mbean, massIndexerObjName, mbeanServer); } catch (Exception e) { throw new CacheException("Unable to create MassIndexer MBean", e); } }
java
private void registerQueryMBeans(ComponentRegistry cr, Configuration cfg, SearchIntegrator searchIntegrator) { AdvancedCache<?, ?> cache = cr.getComponent(Cache.class).getAdvancedCache(); // Resolve MBean server instance GlobalJmxStatisticsConfiguration jmxConfig = cr.getGlobalComponentRegistry().getGlobalConfiguration().globalJmxStatistics(); if (!jmxConfig.enabled()) return; if (mbeanServer == null) { mbeanServer = JmxUtil.lookupMBeanServer(jmxConfig.mbeanServerLookup(), jmxConfig.properties()); } // Resolve jmx domain to use for query MBeans String queryGroupName = getQueryGroupName(jmxConfig.cacheManagerName(), cache.getName()); String jmxDomain = JmxUtil.buildJmxDomain(jmxConfig.domain(), mbeanServer, queryGroupName); // Register query statistics MBean, but only enable it if Infinispan config says so try { ObjectName statsObjName = new ObjectName(jmxDomain + ":" + queryGroupName + ",component=Statistics"); InfinispanQueryStatisticsInfo stats = new InfinispanQueryStatisticsInfo(searchIntegrator, statsObjName); stats.setStatisticsEnabled(cfg.jmxStatistics().enabled()); JmxUtil.registerMBean(stats, statsObjName, mbeanServer); cr.registerComponent(stats, InfinispanQueryStatisticsInfo.class); } catch (Exception e) { throw new CacheException("Unable to register query statistics MBean", e); } // Register mass indexer MBean, picking metadata from repo ManageableComponentMetadata massIndexerCompMetadata = cr.getGlobalComponentRegistry().getComponentMetadataRepo() .findComponentMetadata(MassIndexer.class) .toManageableComponentMetadata(); try { KeyTransformationHandler keyTransformationHandler = ComponentRegistryUtils.getKeyTransformationHandler(cache); TimeService timeService = ComponentRegistryUtils.getTimeService(cache); // TODO: MassIndexer should be some kind of query cache component? DistributedExecutorMassIndexer massIndexer = new DistributedExecutorMassIndexer(cache, searchIntegrator, keyTransformationHandler, timeService); ResourceDMBean mbean = new ResourceDMBean(massIndexer, massIndexerCompMetadata); ObjectName massIndexerObjName = new ObjectName(jmxDomain + ":" + queryGroupName + ",component=" + massIndexerCompMetadata.getJmxObjectName()); JmxUtil.registerMBean(mbean, massIndexerObjName, mbeanServer); } catch (Exception e) { throw new CacheException("Unable to create MassIndexer MBean", e); } }
[ "private", "void", "registerQueryMBeans", "(", "ComponentRegistry", "cr", ",", "Configuration", "cfg", ",", "SearchIntegrator", "searchIntegrator", ")", "{", "AdvancedCache", "<", "?", ",", "?", ">", "cache", "=", "cr", ".", "getComponent", "(", "Cache", ".", ...
Register query statistics and mass-indexer MBeans for a cache.
[ "Register", "query", "statistics", "and", "mass", "-", "indexer", "MBeans", "for", "a", "cache", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/impl/LifecycleManager.java#L280-L324
29,717
infinispan/infinispan
query/src/main/java/org/infinispan/query/impl/LifecycleManager.java
LifecycleManager.makeAggregatedClassLoader
private ClassLoader makeAggregatedClassLoader(ClassLoader globalClassLoader) { // use an ordered set to deduplicate them Set<ClassLoader> classLoaders = new LinkedHashSet<>(6); // add the cache manager's CL if (globalClassLoader != null) { classLoaders.add(globalClassLoader); } // add Infinispan's CL classLoaders.add(AggregatedClassLoader.class.getClassLoader()); // add Hibernate Search's CL classLoaders.add(ClassLoaderService.class.getClassLoader()); // add this module's CL classLoaders.add(getClass().getClassLoader()); // add the TCCL try { ClassLoader tccl = Thread.currentThread().getContextClassLoader(); if (tccl != null) { classLoaders.add(tccl); } } catch (Exception e) { // ignored } // add the system CL try { ClassLoader syscl = ClassLoader.getSystemClassLoader(); if (syscl != null) { classLoaders.add(syscl); } } catch (Exception e) { // ignored } return new AggregatedClassLoader(classLoaders); }
java
private ClassLoader makeAggregatedClassLoader(ClassLoader globalClassLoader) { // use an ordered set to deduplicate them Set<ClassLoader> classLoaders = new LinkedHashSet<>(6); // add the cache manager's CL if (globalClassLoader != null) { classLoaders.add(globalClassLoader); } // add Infinispan's CL classLoaders.add(AggregatedClassLoader.class.getClassLoader()); // add Hibernate Search's CL classLoaders.add(ClassLoaderService.class.getClassLoader()); // add this module's CL classLoaders.add(getClass().getClassLoader()); // add the TCCL try { ClassLoader tccl = Thread.currentThread().getContextClassLoader(); if (tccl != null) { classLoaders.add(tccl); } } catch (Exception e) { // ignored } // add the system CL try { ClassLoader syscl = ClassLoader.getSystemClassLoader(); if (syscl != null) { classLoaders.add(syscl); } } catch (Exception e) { // ignored } return new AggregatedClassLoader(classLoaders); }
[ "private", "ClassLoader", "makeAggregatedClassLoader", "(", "ClassLoader", "globalClassLoader", ")", "{", "// use an ordered set to deduplicate them", "Set", "<", "ClassLoader", ">", "classLoaders", "=", "new", "LinkedHashSet", "<>", "(", "6", ")", ";", "// add the cache ...
Create a class loader that delegates loading to an ordered set of class loaders. @param globalClassLoader the cache manager's global ClassLoader from GlobalConfiguration @return the aggregated ClassLoader
[ "Create", "a", "class", "loader", "that", "delegates", "loading", "to", "an", "ordered", "set", "of", "class", "loaders", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/impl/LifecycleManager.java#L365-L405
29,718
infinispan/infinispan
query/src/main/java/org/infinispan/query/impl/LifecycleManager.java
LifecycleManager.unregisterQueryMBeans
private void unregisterQueryMBeans(ComponentRegistry cr, String cacheName) { if (mbeanServer != null) { try { InfinispanQueryStatisticsInfo stats = cr.getComponent(InfinispanQueryStatisticsInfo.class); if (stats != null) { GlobalJmxStatisticsConfiguration jmxConfig = cr.getGlobalComponentRegistry().getGlobalConfiguration().globalJmxStatistics(); String queryGroupName = getQueryGroupName(jmxConfig.cacheManagerName(), cacheName); String queryMBeanFilter = stats.getObjectName().getDomain() + ":" + queryGroupName + ",*"; JmxUtil.unregisterMBeans(queryMBeanFilter, mbeanServer); } } catch (Exception e) { throw new CacheException("Unable to unregister query MBeans", e); } } }
java
private void unregisterQueryMBeans(ComponentRegistry cr, String cacheName) { if (mbeanServer != null) { try { InfinispanQueryStatisticsInfo stats = cr.getComponent(InfinispanQueryStatisticsInfo.class); if (stats != null) { GlobalJmxStatisticsConfiguration jmxConfig = cr.getGlobalComponentRegistry().getGlobalConfiguration().globalJmxStatistics(); String queryGroupName = getQueryGroupName(jmxConfig.cacheManagerName(), cacheName); String queryMBeanFilter = stats.getObjectName().getDomain() + ":" + queryGroupName + ",*"; JmxUtil.unregisterMBeans(queryMBeanFilter, mbeanServer); } } catch (Exception e) { throw new CacheException("Unable to unregister query MBeans", e); } } }
[ "private", "void", "unregisterQueryMBeans", "(", "ComponentRegistry", "cr", ",", "String", "cacheName", ")", "{", "if", "(", "mbeanServer", "!=", "null", ")", "{", "try", "{", "InfinispanQueryStatisticsInfo", "stats", "=", "cr", ".", "getComponent", "(", "Infini...
Unregister query related MBeans for a cache, primarily the statistics, but also all other MBeans from the same related group.
[ "Unregister", "query", "related", "MBeans", "for", "a", "cache", "primarily", "the", "statistics", "but", "also", "all", "other", "MBeans", "from", "the", "same", "related", "group", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/impl/LifecycleManager.java#L426-L440
29,719
infinispan/infinispan
core/src/main/java/org/infinispan/statetransfer/CommitManager.java
CommitManager.stopTrack
public final void stopTrack(Flag track) { setTrack(track, false); if (!trackStateTransfer && !trackXSiteStateTransfer) { if (trace) { log.tracef("Tracking is disabled. Clear tracker: %s", tracker); } tracker.clear(); } else { for (Iterator<Map.Entry<Object, DiscardPolicy>> iterator = tracker.entrySet().iterator(); iterator.hasNext(); ) { if (iterator.next().getValue().update(trackStateTransfer, trackXSiteStateTransfer)) { iterator.remove(); } } } }
java
public final void stopTrack(Flag track) { setTrack(track, false); if (!trackStateTransfer && !trackXSiteStateTransfer) { if (trace) { log.tracef("Tracking is disabled. Clear tracker: %s", tracker); } tracker.clear(); } else { for (Iterator<Map.Entry<Object, DiscardPolicy>> iterator = tracker.entrySet().iterator(); iterator.hasNext(); ) { if (iterator.next().getValue().update(trackStateTransfer, trackXSiteStateTransfer)) { iterator.remove(); } } } }
[ "public", "final", "void", "stopTrack", "(", "Flag", "track", ")", "{", "setTrack", "(", "track", ",", "false", ")", ";", "if", "(", "!", "trackStateTransfer", "&&", "!", "trackXSiteStateTransfer", ")", "{", "if", "(", "trace", ")", "{", "log", ".", "t...
It stops tracking keys committed. @param track Flag to stop tracking keys for local site state transfer or for remote site state transfer.
[ "It", "stops", "tracking", "keys", "committed", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/statetransfer/CommitManager.java#L60-L75
29,720
infinispan/infinispan
core/src/main/java/org/infinispan/statetransfer/CommitManager.java
CommitManager.commit
public final void commit(final CacheEntry entry, final Flag operation, int segment, boolean l1Only, InvocationContext ctx) { if (trace) { log.tracef("Trying to commit. Key=%s. Operation Flag=%s, L1 write/invalidation=%s", toStr(entry.getKey()), operation, l1Only); } if (l1Only || (operation == null && !trackStateTransfer && !trackXSiteStateTransfer)) { //track == null means that it is a normal put and the tracking is not enabled! //if it is a L1 invalidation, commit without track it. if (trace) { log.tracef("Committing key=%s. It is a L1 invalidation or a normal put and no tracking is enabled!", toStr(entry.getKey())); } commitEntry(entry, segment, ctx); return; } if (isTrackDisabled(operation)) { //this a put for state transfer but we are not tracking it. This means that the state transfer has ended //or canceled due to a clear command. if (trace) { log.tracef("Not committing key=%s. It is a state transfer key but no track is enabled!", toStr(entry.getKey())); } return; } tracker.compute(entry.getKey(), (o, discardPolicy) -> { if (discardPolicy != null && discardPolicy.ignore(operation)) { if (trace) { log.tracef("Not committing key=%s. It was already overwritten! Discard policy=%s", toStr(entry.getKey()), discardPolicy); } return discardPolicy; } commitEntry(entry, segment, ctx); DiscardPolicy newDiscardPolicy = calculateDiscardPolicy(operation); if (trace) { log.tracef("Committed key=%s. Old discard policy=%s. New discard policy=%s", toStr(entry.getKey()), discardPolicy, newDiscardPolicy); } return newDiscardPolicy; }); }
java
public final void commit(final CacheEntry entry, final Flag operation, int segment, boolean l1Only, InvocationContext ctx) { if (trace) { log.tracef("Trying to commit. Key=%s. Operation Flag=%s, L1 write/invalidation=%s", toStr(entry.getKey()), operation, l1Only); } if (l1Only || (operation == null && !trackStateTransfer && !trackXSiteStateTransfer)) { //track == null means that it is a normal put and the tracking is not enabled! //if it is a L1 invalidation, commit without track it. if (trace) { log.tracef("Committing key=%s. It is a L1 invalidation or a normal put and no tracking is enabled!", toStr(entry.getKey())); } commitEntry(entry, segment, ctx); return; } if (isTrackDisabled(operation)) { //this a put for state transfer but we are not tracking it. This means that the state transfer has ended //or canceled due to a clear command. if (trace) { log.tracef("Not committing key=%s. It is a state transfer key but no track is enabled!", toStr(entry.getKey())); } return; } tracker.compute(entry.getKey(), (o, discardPolicy) -> { if (discardPolicy != null && discardPolicy.ignore(operation)) { if (trace) { log.tracef("Not committing key=%s. It was already overwritten! Discard policy=%s", toStr(entry.getKey()), discardPolicy); } return discardPolicy; } commitEntry(entry, segment, ctx); DiscardPolicy newDiscardPolicy = calculateDiscardPolicy(operation); if (trace) { log.tracef("Committed key=%s. Old discard policy=%s. New discard policy=%s", toStr(entry.getKey()), discardPolicy, newDiscardPolicy); } return newDiscardPolicy; }); }
[ "public", "final", "void", "commit", "(", "final", "CacheEntry", "entry", ",", "final", "Flag", "operation", ",", "int", "segment", ",", "boolean", "l1Only", ",", "InvocationContext", "ctx", ")", "{", "if", "(", "trace", ")", "{", "log", ".", "tracef", "...
It tries to commit the cache entry. The entry is not committed if it is originated from state transfer and other operation already has updated it. @param entry the entry to commit @param operation if {@code null}, it identifies this commit as originated from a normal operation. Otherwise, it @param ctx
[ "It", "tries", "to", "commit", "the", "cache", "entry", ".", "The", "entry", "is", "not", "committed", "if", "it", "is", "originated", "from", "state", "transfer", "and", "other", "operation", "already", "has", "updated", "it", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/statetransfer/CommitManager.java#L84-L125
29,721
infinispan/infinispan
lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/TransactionalSharedLuceneLock.java
TransactionalSharedLuceneLock.commitTransactions
private void commitTransactions() throws IOException { try { tm.commit(); } catch (Exception e) { log.unableToCommitTransaction(e); throw new IOException("SharedLuceneLock could not commit a transaction", e); } if (trace) { log.tracef("Batch transaction committed for index: %s", indexName); } }
java
private void commitTransactions() throws IOException { try { tm.commit(); } catch (Exception e) { log.unableToCommitTransaction(e); throw new IOException("SharedLuceneLock could not commit a transaction", e); } if (trace) { log.tracef("Batch transaction committed for index: %s", indexName); } }
[ "private", "void", "commitTransactions", "(", ")", "throws", "IOException", "{", "try", "{", "tm", ".", "commit", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "log", ".", "unableToCommitTransaction", "(", "e", ")", ";", "throw", "new", ...
Commits the existing transaction. It's illegal to call this if a transaction was not started. @throws IOException wraps Infinispan exceptions to adapt to Lucene's API
[ "Commits", "the", "existing", "transaction", ".", "It", "s", "illegal", "to", "call", "this", "if", "a", "transaction", "was", "not", "started", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/TransactionalSharedLuceneLock.java#L128-L139
29,722
infinispan/infinispan
lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/TransactionalSharedLuceneLock.java
TransactionalSharedLuceneLock.clearLockSuspending
public void clearLockSuspending() { Transaction tx = null; try { // if there is an ongoing transaction we need to suspend it if ((tx = tm.getTransaction()) != null) { tm.suspend(); } clearLock(); } catch (Exception e) { log.errorSuspendingTransaction(e); } finally { if (tx != null) { try { tm.resume(tx); } catch (Exception e) { throw new CacheException("Unable to resume suspended transaction " + tx, e); } } } }
java
public void clearLockSuspending() { Transaction tx = null; try { // if there is an ongoing transaction we need to suspend it if ((tx = tm.getTransaction()) != null) { tm.suspend(); } clearLock(); } catch (Exception e) { log.errorSuspendingTransaction(e); } finally { if (tx != null) { try { tm.resume(tx); } catch (Exception e) { throw new CacheException("Unable to resume suspended transaction " + tx, e); } } } }
[ "public", "void", "clearLockSuspending", "(", ")", "{", "Transaction", "tx", "=", "null", ";", "try", "{", "// if there is an ongoing transaction we need to suspend it", "if", "(", "(", "tx", "=", "tm", ".", "getTransaction", "(", ")", ")", "!=", "null", ")", ...
Will clear the lock, eventually suspending a running transaction to make sure the release is immediately taking effect.
[ "Will", "clear", "the", "lock", "eventually", "suspending", "a", "running", "transaction", "to", "make", "sure", "the", "release", "is", "immediately", "taking", "effect", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/TransactionalSharedLuceneLock.java#L145-L166
29,723
infinispan/infinispan
core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java
DummyBaseTransactionManager.begin
@Override public void begin() throws NotSupportedException, SystemException { Transaction currentTx; if ((currentTx = getTransaction()) != null) throw new NotSupportedException(Thread.currentThread() + " is already associated with a transaction (" + currentTx + ")"); DummyTransaction tx = new DummyTransaction(this); setTransaction(tx); }
java
@Override public void begin() throws NotSupportedException, SystemException { Transaction currentTx; if ((currentTx = getTransaction()) != null) throw new NotSupportedException(Thread.currentThread() + " is already associated with a transaction (" + currentTx + ")"); DummyTransaction tx = new DummyTransaction(this); setTransaction(tx); }
[ "@", "Override", "public", "void", "begin", "(", ")", "throws", "NotSupportedException", ",", "SystemException", "{", "Transaction", "currentTx", ";", "if", "(", "(", "currentTx", "=", "getTransaction", "(", ")", ")", "!=", "null", ")", "throw", "new", "NotS...
Starts a new transaction, and associate it with the calling thread. @throws javax.transaction.NotSupportedException If the calling thread is already associated with a transaction, and nested transactions are not supported. @throws javax.transaction.SystemException If the transaction service fails in an unexpected way.
[ "Starts", "a", "new", "transaction", "and", "associate", "it", "with", "the", "calling", "thread", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java#L43-L51
29,724
infinispan/infinispan
core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java
DummyBaseTransactionManager.commit
@Override public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { DummyTransaction tx = getTransaction(); if (tx == null) throw new IllegalStateException("thread not associated with transaction"); tx.commit(); // Disassociate tx from thread. setTransaction(null); }
java
@Override public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { DummyTransaction tx = getTransaction(); if (tx == null) throw new IllegalStateException("thread not associated with transaction"); tx.commit(); // Disassociate tx from thread. setTransaction(null); }
[ "@", "Override", "public", "void", "commit", "(", ")", "throws", "RollbackException", ",", "HeuristicMixedException", ",", "HeuristicRollbackException", ",", "SecurityException", ",", "IllegalStateException", ",", "SystemException", "{", "DummyTransaction", "tx", "=", "...
Commit the transaction associated with the calling thread. @throws javax.transaction.RollbackException If the transaction was marked for rollback only, the transaction is rolled back and this exception is thrown. @throws IllegalStateException If the calling thread is not associated with a transaction. @throws javax.transaction.SystemException If the transaction service fails in an unexpected way. @throws javax.transaction.HeuristicMixedException If a heuristic decision was made and some some parts of the transaction have been committed while other parts have been rolled back. @throws javax.transaction.HeuristicRollbackException If a heuristic decision to roll back the transaction was made. @throws SecurityException If the caller is not allowed to commit this transaction.
[ "Commit", "the", "transaction", "associated", "with", "the", "calling", "thread", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java#L69-L80
29,725
infinispan/infinispan
core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java
DummyBaseTransactionManager.rollback
@Override public void rollback() throws IllegalStateException, SecurityException, SystemException { Transaction tx = getTransaction(); if (tx == null) throw new IllegalStateException("no transaction associated with thread"); tx.rollback(); // Disassociate tx from thread. setTransaction(null); }
java
@Override public void rollback() throws IllegalStateException, SecurityException, SystemException { Transaction tx = getTransaction(); if (tx == null) throw new IllegalStateException("no transaction associated with thread"); tx.rollback(); // Disassociate tx from thread. setTransaction(null); }
[ "@", "Override", "public", "void", "rollback", "(", ")", "throws", "IllegalStateException", ",", "SecurityException", ",", "SystemException", "{", "Transaction", "tx", "=", "getTransaction", "(", ")", ";", "if", "(", "tx", "==", "null", ")", "throw", "new", ...
Rolls back the transaction associated with the calling thread. @throws IllegalStateException If the transaction is in a state where it cannot be rolled back. This could be because the calling thread is not associated with a transaction, or because it is in the {@link javax.transaction.Status#STATUS_PREPARED prepared state}. @throws SecurityException If the caller is not allowed to roll back this transaction. @throws javax.transaction.SystemException If the transaction service fails in an unexpected way.
[ "Rolls", "back", "the", "transaction", "associated", "with", "the", "calling", "thread", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java#L92-L102
29,726
infinispan/infinispan
core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java
DummyBaseTransactionManager.setRollbackOnly
@Override public void setRollbackOnly() throws IllegalStateException, SystemException { Transaction tx = getTransaction(); if (tx == null) throw new IllegalStateException("no transaction associated with calling thread"); tx.setRollbackOnly(); }
java
@Override public void setRollbackOnly() throws IllegalStateException, SystemException { Transaction tx = getTransaction(); if (tx == null) throw new IllegalStateException("no transaction associated with calling thread"); tx.setRollbackOnly(); }
[ "@", "Override", "public", "void", "setRollbackOnly", "(", ")", "throws", "IllegalStateException", ",", "SystemException", "{", "Transaction", "tx", "=", "getTransaction", "(", ")", ";", "if", "(", "tx", "==", "null", ")", "throw", "new", "IllegalStateException"...
Mark the transaction associated with the calling thread for rollback only. @throws IllegalStateException If the transaction is in a state where it cannot be rolled back. This could be because the calling thread is not associated with a transaction, or because it is in the {@link javax.transaction.Status#STATUS_PREPARED prepared state}. @throws javax.transaction.SystemException If the transaction service fails in an unexpected way.
[ "Mark", "the", "transaction", "associated", "with", "the", "calling", "thread", "for", "rollback", "only", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java#L113-L119
29,727
infinispan/infinispan
core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java
DummyBaseTransactionManager.suspend
@Override public Transaction suspend() throws SystemException { Transaction retval = getTransaction(); setTransaction(null); if (trace) log.tracef("Suspending tx %s", retval); return retval; }
java
@Override public Transaction suspend() throws SystemException { Transaction retval = getTransaction(); setTransaction(null); if (trace) log.tracef("Suspending tx %s", retval); return retval; }
[ "@", "Override", "public", "Transaction", "suspend", "(", ")", "throws", "SystemException", "{", "Transaction", "retval", "=", "getTransaction", "(", ")", ";", "setTransaction", "(", "null", ")", ";", "if", "(", "trace", ")", "log", ".", "tracef", "(", "\"...
Suspend the association the calling thread has to a transaction, and return the suspended transaction. When returning from this method, the calling thread is no longer associated with a transaction. @return The transaction that the calling thread was associated with, or <code>null</code> if the calling thread was not associated with a transaction. @throws javax.transaction.SystemException If the transaction service fails in an unexpected way.
[ "Suspend", "the", "association", "the", "calling", "thread", "has", "to", "a", "transaction", "and", "return", "the", "suspended", "transaction", ".", "When", "returning", "from", "this", "method", "the", "calling", "thread", "is", "no", "longer", "associated", ...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java#L171-L177
29,728
infinispan/infinispan
core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java
DummyBaseTransactionManager.resume
@Override public void resume(Transaction tx) throws InvalidTransactionException, IllegalStateException, SystemException { if (trace) log.tracef("Resuming tx %s", tx); setTransaction(tx); }
java
@Override public void resume(Transaction tx) throws InvalidTransactionException, IllegalStateException, SystemException { if (trace) log.tracef("Resuming tx %s", tx); setTransaction(tx); }
[ "@", "Override", "public", "void", "resume", "(", "Transaction", "tx", ")", "throws", "InvalidTransactionException", ",", "IllegalStateException", ",", "SystemException", "{", "if", "(", "trace", ")", "log", ".", "tracef", "(", "\"Resuming tx %s\"", ",", "tx", "...
Resume the association of the calling thread with the given transaction. @param tx The transaction to be associated with the calling thread. @throws javax.transaction.InvalidTransactionException If the argument does not represent a valid transaction. @throws IllegalStateException If the calling thread is already associated with a transaction. @throws javax.transaction.SystemException If the transaction service fails in an unexpected way.
[ "Resume", "the", "association", "of", "the", "calling", "thread", "with", "the", "given", "transaction", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/transaction/tm/DummyBaseTransactionManager.java#L189-L193
29,729
infinispan/infinispan
query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java
QueryInterceptor.removeFromIndexes
void removeFromIndexes(TransactionContext transactionContext, Object key) { Stream<IndexedTypeIdentifier> typeIdentifiers = getKnownClasses().stream() .filter(searchFactoryHandler::hasIndex) .map(PojoIndexedTypeIdentifier::new); Set<Work> deleteWorks = typeIdentifiers .map(e -> searchWorkCreator.createEntityWork(keyToString(key), e, WorkType.DELETE)) .collect(Collectors.toSet()); performSearchWorks(deleteWorks, transactionContext); }
java
void removeFromIndexes(TransactionContext transactionContext, Object key) { Stream<IndexedTypeIdentifier> typeIdentifiers = getKnownClasses().stream() .filter(searchFactoryHandler::hasIndex) .map(PojoIndexedTypeIdentifier::new); Set<Work> deleteWorks = typeIdentifiers .map(e -> searchWorkCreator.createEntityWork(keyToString(key), e, WorkType.DELETE)) .collect(Collectors.toSet()); performSearchWorks(deleteWorks, transactionContext); }
[ "void", "removeFromIndexes", "(", "TransactionContext", "transactionContext", ",", "Object", "key", ")", "{", "Stream", "<", "IndexedTypeIdentifier", ">", "typeIdentifiers", "=", "getKnownClasses", "(", ")", ".", "stream", "(", ")", ".", "filter", "(", "searchFact...
Remove entries from all indexes by key.
[ "Remove", "entries", "from", "all", "indexes", "by", "key", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java#L334-L342
29,730
infinispan/infinispan
query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java
QueryInterceptor.removeFromIndexes
private void removeFromIndexes(Object value, Object key, TransactionContext transactionContext) { performSearchWork(value, keyToString(key), WorkType.DELETE, transactionContext); }
java
private void removeFromIndexes(Object value, Object key, TransactionContext transactionContext) { performSearchWork(value, keyToString(key), WorkType.DELETE, transactionContext); }
[ "private", "void", "removeFromIndexes", "(", "Object", "value", ",", "Object", "key", ",", "TransactionContext", "transactionContext", ")", "{", "performSearchWork", "(", "value", ",", "keyToString", "(", "key", ")", ",", "WorkType", ".", "DELETE", ",", "transac...
Method that will be called when data needs to be removed from Lucene.
[ "Method", "that", "will", "be", "called", "when", "data", "needs", "to", "be", "removed", "from", "Lucene", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java#L365-L367
29,731
infinispan/infinispan
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/counter/operation/BaseCounterOperation.java
BaseCounterOperation.sendHeaderAndCounterNameAndRead
void sendHeaderAndCounterNameAndRead(Channel channel) { ByteBuf buf = getHeaderAndCounterNameBufferAndRead(channel, 0); channel.writeAndFlush(buf); }
java
void sendHeaderAndCounterNameAndRead(Channel channel) { ByteBuf buf = getHeaderAndCounterNameBufferAndRead(channel, 0); channel.writeAndFlush(buf); }
[ "void", "sendHeaderAndCounterNameAndRead", "(", "Channel", "channel", ")", "{", "ByteBuf", "buf", "=", "getHeaderAndCounterNameBufferAndRead", "(", "channel", ",", "0", ")", ";", "channel", ".", "writeAndFlush", "(", "buf", ")", ";", "}" ]
Writes the operation header followed by the counter's name.
[ "Writes", "the", "operation", "header", "followed", "by", "the", "counter", "s", "name", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/counter/operation/BaseCounterOperation.java#L51-L54
29,732
infinispan/infinispan
core/src/main/java/org/infinispan/container/impl/AbstractInternalDataContainer.java
AbstractInternalDataContainer.filterExpiredEntries
protected Spliterator<InternalCacheEntry<K, V>> filterExpiredEntries(Spliterator<InternalCacheEntry<K, V>> spliterator) { // This way we only read the wall clock time at the beginning long accessTime = timeService.wallClockTime(); return new FilterSpliterator<>(spliterator, expiredIterationPredicate(accessTime)); }
java
protected Spliterator<InternalCacheEntry<K, V>> filterExpiredEntries(Spliterator<InternalCacheEntry<K, V>> spliterator) { // This way we only read the wall clock time at the beginning long accessTime = timeService.wallClockTime(); return new FilterSpliterator<>(spliterator, expiredIterationPredicate(accessTime)); }
[ "protected", "Spliterator", "<", "InternalCacheEntry", "<", "K", ",", "V", ">", ">", "filterExpiredEntries", "(", "Spliterator", "<", "InternalCacheEntry", "<", "K", ",", "V", ">", ">", "spliterator", ")", "{", "// This way we only read the wall clock time at the begi...
Returns a new spliterator that will not return entries that have expired. @param spliterator the spliterator to filter expired entries out of @return new spliterator with expired entries filtered
[ "Returns", "a", "new", "spliterator", "that", "will", "not", "return", "entries", "that", "have", "expired", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/container/impl/AbstractInternalDataContainer.java#L554-L558
29,733
infinispan/infinispan
core/src/main/java/org/infinispan/container/impl/AbstractInternalDataContainer.java
AbstractInternalDataContainer.expiredIterationPredicate
protected Predicate<InternalCacheEntry<K, V>> expiredIterationPredicate(long accessTime) { return e -> ! e.canExpire() || ! (e.isExpired(accessTime) && expirationManager.entryExpiredInMemoryFromIteration(e, accessTime).join() == Boolean.TRUE); }
java
protected Predicate<InternalCacheEntry<K, V>> expiredIterationPredicate(long accessTime) { return e -> ! e.canExpire() || ! (e.isExpired(accessTime) && expirationManager.entryExpiredInMemoryFromIteration(e, accessTime).join() == Boolean.TRUE); }
[ "protected", "Predicate", "<", "InternalCacheEntry", "<", "K", ",", "V", ">", ">", "expiredIterationPredicate", "(", "long", "accessTime", ")", "{", "return", "e", "->", "!", "e", ".", "canExpire", "(", ")", "||", "!", "(", "e", ".", "isExpired", "(", ...
Returns a predicate that will return false when an entry is expired. This predicate assumes this is invoked from an iteration process. @param accessTime the access time to base expiration off of @return predicate that returns true if an entry is not expired
[ "Returns", "a", "predicate", "that", "will", "return", "false", "when", "an", "entry", "is", "expired", ".", "This", "predicate", "assumes", "this", "is", "invoked", "from", "an", "iteration", "process", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/container/impl/AbstractInternalDataContainer.java#L566-L569
29,734
infinispan/infinispan
server/hotrod/src/main/java/org/infinispan/server/hotrod/TransactionRequestProcessor.java
TransactionRequestProcessor.rollbackTransaction
void rollbackTransaction(HotRodHeader header, Subject subject, XidImpl xid) { RollbackTransactionOperation operation = new RollbackTransactionOperation(header, server, subject, xid, this::writeTransactionResponse); executor.execute(operation); }
java
void rollbackTransaction(HotRodHeader header, Subject subject, XidImpl xid) { RollbackTransactionOperation operation = new RollbackTransactionOperation(header, server, subject, xid, this::writeTransactionResponse); executor.execute(operation); }
[ "void", "rollbackTransaction", "(", "HotRodHeader", "header", ",", "Subject", "subject", ",", "XidImpl", "xid", ")", "{", "RollbackTransactionOperation", "operation", "=", "new", "RollbackTransactionOperation", "(", "header", ",", "server", ",", "subject", ",", "xid...
Handles a rollback request from a client.
[ "Handles", "a", "rollback", "request", "from", "a", "client", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/TransactionRequestProcessor.java#L47-L51
29,735
infinispan/infinispan
server/hotrod/src/main/java/org/infinispan/server/hotrod/TransactionRequestProcessor.java
TransactionRequestProcessor.commitTransaction
void commitTransaction(HotRodHeader header, Subject subject, XidImpl xid) { CommitTransactionOperation operation = new CommitTransactionOperation(header, server, subject, xid, this::writeTransactionResponse); executor.execute(operation); }
java
void commitTransaction(HotRodHeader header, Subject subject, XidImpl xid) { CommitTransactionOperation operation = new CommitTransactionOperation(header, server, subject, xid, this::writeTransactionResponse); executor.execute(operation); }
[ "void", "commitTransaction", "(", "HotRodHeader", "header", ",", "Subject", "subject", ",", "XidImpl", "xid", ")", "{", "CommitTransactionOperation", "operation", "=", "new", "CommitTransactionOperation", "(", "header", ",", "server", ",", "subject", ",", "xid", "...
Handles a commit request from a client
[ "Handles", "a", "commit", "request", "from", "a", "client" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/TransactionRequestProcessor.java#L56-L60
29,736
infinispan/infinispan
server/hotrod/src/main/java/org/infinispan/server/hotrod/TransactionRequestProcessor.java
TransactionRequestProcessor.prepareTransaction
void prepareTransaction(HotRodHeader header, Subject subject, XidImpl xid, boolean onePhaseCommit, List<TransactionWrite> writes, boolean recoverable, long timeout) { HotRodServer.CacheInfo cacheInfo = server.getCacheInfo(header); AdvancedCache<byte[], byte[]> cache = server.cache(cacheInfo, header, subject); validateConfiguration(cache); executor.execute(() -> prepareTransactionInternal(header, cache, cacheInfo.versionGenerator, xid, onePhaseCommit, writes, recoverable, timeout)); }
java
void prepareTransaction(HotRodHeader header, Subject subject, XidImpl xid, boolean onePhaseCommit, List<TransactionWrite> writes, boolean recoverable, long timeout) { HotRodServer.CacheInfo cacheInfo = server.getCacheInfo(header); AdvancedCache<byte[], byte[]> cache = server.cache(cacheInfo, header, subject); validateConfiguration(cache); executor.execute(() -> prepareTransactionInternal(header, cache, cacheInfo.versionGenerator, xid, onePhaseCommit, writes, recoverable, timeout)); }
[ "void", "prepareTransaction", "(", "HotRodHeader", "header", ",", "Subject", "subject", ",", "XidImpl", "xid", ",", "boolean", "onePhaseCommit", ",", "List", "<", "TransactionWrite", ">", "writes", ",", "boolean", "recoverable", ",", "long", "timeout", ")", "{",...
Handles a prepare request from a client
[ "Handles", "a", "prepare", "request", "from", "a", "client" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/TransactionRequestProcessor.java#L65-L72
29,737
infinispan/infinispan
server/hotrod/src/main/java/org/infinispan/server/hotrod/TransactionRequestProcessor.java
TransactionRequestProcessor.isValid
private boolean isValid(TransactionWrite write, AdvancedCache<byte[], byte[]> readCache) { if (write.skipRead()) { if (isTrace) { log.tracef("Operation %s wasn't read.", write); } return true; } CacheEntry<byte[], byte[]> entry = readCache.getCacheEntry(write.key); if (write.wasNonExisting()) { if (isTrace) { log.tracef("Key didn't exist for operation %s. Entry is %s", write, entry); } return entry == null || entry.getValue() == null; } if (isTrace) { log.tracef("Checking version for operation %s. Entry is %s", write, entry); } return entry != null && write.versionRead == MetadataUtils.extractVersion(entry); }
java
private boolean isValid(TransactionWrite write, AdvancedCache<byte[], byte[]> readCache) { if (write.skipRead()) { if (isTrace) { log.tracef("Operation %s wasn't read.", write); } return true; } CacheEntry<byte[], byte[]> entry = readCache.getCacheEntry(write.key); if (write.wasNonExisting()) { if (isTrace) { log.tracef("Key didn't exist for operation %s. Entry is %s", write, entry); } return entry == null || entry.getValue() == null; } if (isTrace) { log.tracef("Checking version for operation %s. Entry is %s", write, entry); } return entry != null && write.versionRead == MetadataUtils.extractVersion(entry); }
[ "private", "boolean", "isValid", "(", "TransactionWrite", "write", ",", "AdvancedCache", "<", "byte", "[", "]", ",", "byte", "[", "]", ">", "readCache", ")", "{", "if", "(", "write", ".", "skipRead", "(", ")", ")", "{", "if", "(", "isTrace", ")", "{"...
Validates if the value read is still valid and the write operation can proceed.
[ "Validates", "if", "the", "value", "read", "is", "still", "valid", "and", "the", "write", "operation", "can", "proceed", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/TransactionRequestProcessor.java#L248-L266
29,738
infinispan/infinispan
object-filter/src/main/java/org/infinispan/objectfilter/impl/ql/QueryParser.java
QueryParser.parseQuery
public CommonTree parseQuery(String queryString, QueryResolverDelegate resolverDelegate, QueryRendererDelegate rendererDelegate) throws ParsingException { IckleLexer lexer = new IckleLexer(new ANTLRStringStream(queryString)); CommonTokenStream tokens = new CommonTokenStream(lexer); IckleParser parser = new IckleParser(tokens); try { // parser.statement() is the entry point for evaluation of any kind of statement IckleParser.statement_return r = parser.statement(); if (parser.hasErrors()) { throw log.getQuerySyntaxException(queryString, parser.getErrorMessages()); } CommonTree tree = (CommonTree) r.getTree(); tree = resolve(tokens, tree, resolverDelegate); tree = render(tokens, tree, rendererDelegate); return tree; } catch (RecognitionException e) { throw log.getQuerySyntaxException(queryString, e); } }
java
public CommonTree parseQuery(String queryString, QueryResolverDelegate resolverDelegate, QueryRendererDelegate rendererDelegate) throws ParsingException { IckleLexer lexer = new IckleLexer(new ANTLRStringStream(queryString)); CommonTokenStream tokens = new CommonTokenStream(lexer); IckleParser parser = new IckleParser(tokens); try { // parser.statement() is the entry point for evaluation of any kind of statement IckleParser.statement_return r = parser.statement(); if (parser.hasErrors()) { throw log.getQuerySyntaxException(queryString, parser.getErrorMessages()); } CommonTree tree = (CommonTree) r.getTree(); tree = resolve(tokens, tree, resolverDelegate); tree = render(tokens, tree, rendererDelegate); return tree; } catch (RecognitionException e) { throw log.getQuerySyntaxException(queryString, e); } }
[ "public", "CommonTree", "parseQuery", "(", "String", "queryString", ",", "QueryResolverDelegate", "resolverDelegate", ",", "QueryRendererDelegate", "rendererDelegate", ")", "throws", "ParsingException", "{", "IckleLexer", "lexer", "=", "new", "IckleLexer", "(", "new", "...
Parses the given query string. @param queryString the query string to parse @return the result of the parsing after being transformed by the processors @throws ParsingException in case any exception occurs during parsing
[ "Parses", "the", "given", "query", "string", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/object-filter/src/main/java/org/infinispan/objectfilter/impl/ql/QueryParser.java#L55-L75
29,739
infinispan/infinispan
core/src/main/java/org/infinispan/persistence/keymappers/WrappedByteArrayOrPrimitiveMapper.java
WrappedByteArrayOrPrimitiveMapper.serializeObj
private String serializeObj(WrappedByteArray mv) throws Exception { return Base64.getEncoder().encodeToString(mv.getBytes()); }
java
private String serializeObj(WrappedByteArray mv) throws Exception { return Base64.getEncoder().encodeToString(mv.getBytes()); }
[ "private", "String", "serializeObj", "(", "WrappedByteArray", "mv", ")", "throws", "Exception", "{", "return", "Base64", ".", "getEncoder", "(", ")", ".", "encodeToString", "(", "mv", ".", "getBytes", "(", ")", ")", ";", "}" ]
Use MarshalledValue.Externalizer to serialize. @param mv @return @throws Exception
[ "Use", "MarshalledValue", ".", "Externalizer", "to", "serialize", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/persistence/keymappers/WrappedByteArrayOrPrimitiveMapper.java#L64-L66
29,740
infinispan/infinispan
core/src/main/java/org/infinispan/persistence/keymappers/WrappedByteArrayOrPrimitiveMapper.java
WrappedByteArrayOrPrimitiveMapper.deserializeObj
private WrappedByteArray deserializeObj(String key) throws Exception { byte[] data = Base64.getDecoder().decode(key); return new WrappedByteArray(data); }
java
private WrappedByteArray deserializeObj(String key) throws Exception { byte[] data = Base64.getDecoder().decode(key); return new WrappedByteArray(data); }
[ "private", "WrappedByteArray", "deserializeObj", "(", "String", "key", ")", "throws", "Exception", "{", "byte", "[", "]", "data", "=", "Base64", ".", "getDecoder", "(", ")", ".", "decode", "(", "key", ")", ";", "return", "new", "WrappedByteArray", "(", "da...
Use MarshalledValue.Externalizer to deserialize. @param key @return @throws Exception
[ "Use", "MarshalledValue", ".", "Externalizer", "to", "deserialize", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/persistence/keymappers/WrappedByteArrayOrPrimitiveMapper.java#L75-L78
29,741
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/util/IntSets.java
IntSets.from
public static IntSet from(Set<Integer> integerSet) { if (integerSet instanceof IntSet) { return (IntSet) integerSet; } int size = integerSet.size(); switch (size) { case 0: return EmptyIntSet.getInstance(); case 1: return new SingletonIntSet(integerSet.iterator().next()); default: return new SmallIntSet(integerSet); } }
java
public static IntSet from(Set<Integer> integerSet) { if (integerSet instanceof IntSet) { return (IntSet) integerSet; } int size = integerSet.size(); switch (size) { case 0: return EmptyIntSet.getInstance(); case 1: return new SingletonIntSet(integerSet.iterator().next()); default: return new SmallIntSet(integerSet); } }
[ "public", "static", "IntSet", "from", "(", "Set", "<", "Integer", ">", "integerSet", ")", "{", "if", "(", "integerSet", "instanceof", "IntSet", ")", "{", "return", "(", "IntSet", ")", "integerSet", ";", "}", "int", "size", "=", "integerSet", ".", "size",...
Returns an IntSet based on the provided Set. This method tries to return or create the most performant IntSet based on the Set provided. If the Set is already an IntSet it will just return that. The returned IntSet may or may not be immutable, so no guarantees are provided from that respect. @param integerSet IntSet to create from @return the IntSet that is equivalent to the Set
[ "Returns", "an", "IntSet", "based", "on", "the", "provided", "Set", ".", "This", "method", "tries", "to", "return", "or", "create", "the", "most", "performant", "IntSet", "based", "on", "the", "Set", "provided", ".", "If", "the", "Set", "is", "already", ...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/IntSets.java#L57-L70
29,742
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/util/IntSets.java
IntSets.from
public static IntSet from(PrimitiveIterator.OfInt iterator) { boolean hasNext = iterator.hasNext(); if (!hasNext) { return EmptyIntSet.getInstance(); } int firstValue = iterator.nextInt(); hasNext = iterator.hasNext(); if (!hasNext) { return new SingletonIntSet(firstValue); } // We have 2 or more values so just set them in the SmallIntSet SmallIntSet set = new SmallIntSet(); set.set(firstValue); iterator.forEachRemaining((IntConsumer) set::set); return set; }
java
public static IntSet from(PrimitiveIterator.OfInt iterator) { boolean hasNext = iterator.hasNext(); if (!hasNext) { return EmptyIntSet.getInstance(); } int firstValue = iterator.nextInt(); hasNext = iterator.hasNext(); if (!hasNext) { return new SingletonIntSet(firstValue); } // We have 2 or more values so just set them in the SmallIntSet SmallIntSet set = new SmallIntSet(); set.set(firstValue); iterator.forEachRemaining((IntConsumer) set::set); return set; }
[ "public", "static", "IntSet", "from", "(", "PrimitiveIterator", ".", "OfInt", "iterator", ")", "{", "boolean", "hasNext", "=", "iterator", ".", "hasNext", "(", ")", ";", "if", "(", "!", "hasNext", ")", "{", "return", "EmptyIntSet", ".", "getInstance", "(",...
Returns an IntSet based on the ints in the iterator. This method will try to return the most performant IntSet based on what ints are provided if any. The returned IntSet may or may not be immutable, so no guarantees are provided from that respect. @param iterator values set in the returned set @return IntSet with all the values set that the iterator had
[ "Returns", "an", "IntSet", "based", "on", "the", "ints", "in", "the", "iterator", ".", "This", "method", "will", "try", "to", "return", "the", "most", "performant", "IntSet", "based", "on", "what", "ints", "are", "provided", "if", "any", ".", "The", "ret...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/IntSets.java#L79-L94
29,743
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/util/IntSets.java
IntSets.mutableFrom
public static IntSet mutableFrom(Set<Integer> integerSet) { if (integerSet instanceof SmallIntSet) { return (SmallIntSet) integerSet; } if (integerSet instanceof ConcurrentSmallIntSet) { return (ConcurrentSmallIntSet) integerSet; } return mutableCopyFrom(integerSet); }
java
public static IntSet mutableFrom(Set<Integer> integerSet) { if (integerSet instanceof SmallIntSet) { return (SmallIntSet) integerSet; } if (integerSet instanceof ConcurrentSmallIntSet) { return (ConcurrentSmallIntSet) integerSet; } return mutableCopyFrom(integerSet); }
[ "public", "static", "IntSet", "mutableFrom", "(", "Set", "<", "Integer", ">", "integerSet", ")", "{", "if", "(", "integerSet", "instanceof", "SmallIntSet", ")", "{", "return", "(", "SmallIntSet", ")", "integerSet", ";", "}", "if", "(", "integerSet", "instanc...
Returns an IntSet that is mutable that contains all of the values from the given set. If this provided Set is already an IntSet and mutable it will return the same object. @param integerSet set to use values from @return IntSet that is mutable with the values set
[ "Returns", "an", "IntSet", "that", "is", "mutable", "that", "contains", "all", "of", "the", "values", "from", "the", "given", "set", ".", "If", "this", "provided", "Set", "is", "already", "an", "IntSet", "and", "mutable", "it", "will", "return", "the", "...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/IntSets.java#L102-L110
29,744
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/util/IntSets.java
IntSets.mutableCopyFrom
public static IntSet mutableCopyFrom(Set<Integer> mutableSet) { if (mutableSet instanceof SingletonIntSet) { return mutableSet(((SingletonIntSet) mutableSet).value); } return new SmallIntSet(mutableSet); }
java
public static IntSet mutableCopyFrom(Set<Integer> mutableSet) { if (mutableSet instanceof SingletonIntSet) { return mutableSet(((SingletonIntSet) mutableSet).value); } return new SmallIntSet(mutableSet); }
[ "public", "static", "IntSet", "mutableCopyFrom", "(", "Set", "<", "Integer", ">", "mutableSet", ")", "{", "if", "(", "mutableSet", "instanceof", "SingletonIntSet", ")", "{", "return", "mutableSet", "(", "(", "(", "SingletonIntSet", ")", "mutableSet", ")", ".",...
Returns an IntSet that contains all ints from the given Set that is mutable. Updates to the original Set or the returned IntSet are not reflected in the other. @param mutableSet set to copy from @return IntSet with the values set
[ "Returns", "an", "IntSet", "that", "contains", "all", "ints", "from", "the", "given", "Set", "that", "is", "mutable", ".", "Updates", "to", "the", "original", "Set", "or", "the", "returned", "IntSet", "are", "not", "reflected", "in", "the", "other", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/IntSets.java#L118-L123
29,745
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/util/IntSets.java
IntSets.concurrentCopyFrom
public static IntSet concurrentCopyFrom(IntSet intSet, int maxExclusive) { ConcurrentSmallIntSet cis = new ConcurrentSmallIntSet(maxExclusive); intSet.forEach((IntConsumer) cis::set); return cis; }
java
public static IntSet concurrentCopyFrom(IntSet intSet, int maxExclusive) { ConcurrentSmallIntSet cis = new ConcurrentSmallIntSet(maxExclusive); intSet.forEach((IntConsumer) cis::set); return cis; }
[ "public", "static", "IntSet", "concurrentCopyFrom", "(", "IntSet", "intSet", ",", "int", "maxExclusive", ")", "{", "ConcurrentSmallIntSet", "cis", "=", "new", "ConcurrentSmallIntSet", "(", "maxExclusive", ")", ";", "intSet", ".", "forEach", "(", "(", "IntConsumer"...
Returns a copy of the given set that supports concurrent operations. The returned set will contain all of the ints the provided set contained. The returned set only supports up to the maximum size the previous int set supported when this method is invoked or the largest int it held. @param intSet set to copy from @param maxExclusive the maximum value - 1 that can be inserted into the set @return concurrent copy
[ "Returns", "a", "copy", "of", "the", "given", "set", "that", "supports", "concurrent", "operations", ".", "The", "returned", "set", "will", "contain", "all", "of", "the", "ints", "the", "provided", "set", "contained", ".", "The", "returned", "set", "only", ...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/IntSets.java#L181-L185
29,746
infinispan/infinispan
jcache/commons/src/main/java/org/infinispan/jcache/RIMBeanServerRegistrationUtility.java
RIMBeanServerRegistrationUtility.isRegistered
static <K, V> boolean isRegistered(AbstractJCache<K, V> cache, ObjectNameType objectNameType) { Set<ObjectName> registeredObjectNames; MBeanServer mBeanServer = cache.getMBeanServer(); if (mBeanServer != null) { ObjectName objectName = calculateObjectName(cache, objectNameType); registeredObjectNames = SecurityActions.queryNames(objectName, null, mBeanServer); return !registeredObjectNames.isEmpty(); } else { return false; } }
java
static <K, V> boolean isRegistered(AbstractJCache<K, V> cache, ObjectNameType objectNameType) { Set<ObjectName> registeredObjectNames; MBeanServer mBeanServer = cache.getMBeanServer(); if (mBeanServer != null) { ObjectName objectName = calculateObjectName(cache, objectNameType); registeredObjectNames = SecurityActions.queryNames(objectName, null, mBeanServer); return !registeredObjectNames.isEmpty(); } else { return false; } }
[ "static", "<", "K", ",", "V", ">", "boolean", "isRegistered", "(", "AbstractJCache", "<", "K", ",", "V", ">", "cache", ",", "ObjectNameType", "objectNameType", ")", "{", "Set", "<", "ObjectName", ">", "registeredObjectNames", ";", "MBeanServer", "mBeanServer",...
Checks whether an ObjectName is already registered. @throws javax.cache.CacheException - all exceptions are wrapped in CacheException
[ "Checks", "whether", "an", "ObjectName", "is", "already", "registered", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/jcache/commons/src/main/java/org/infinispan/jcache/RIMBeanServerRegistrationUtility.java#L82-L94
29,747
infinispan/infinispan
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
RemoteCacheManager.getCache
@Override public <K, V> RemoteCache<K, V> getCache(String cacheName) { return getCache(cacheName, configuration.forceReturnValues(), null, null); }
java
@Override public <K, V> RemoteCache<K, V> getCache(String cacheName) { return getCache(cacheName, configuration.forceReturnValues(), null, null); }
[ "@", "Override", "public", "<", "K", ",", "V", ">", "RemoteCache", "<", "K", ",", "V", ">", "getCache", "(", "String", "cacheName", ")", "{", "return", "getCache", "(", "cacheName", ",", "configuration", ".", "forceReturnValues", "(", ")", ",", "null", ...
Retrieves a named cache from the remote server if the cache has been defined, otherwise if the cache name is undefined, it will return null. @param cacheName name of cache to retrieve @return a cache instance identified by cacheName or null if the cache name has not been defined
[ "Retrieves", "a", "named", "cache", "from", "the", "remote", "server", "if", "the", "cache", "has", "been", "defined", "otherwise", "if", "the", "cache", "name", "is", "undefined", "it", "will", "return", "null", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java#L223-L226
29,748
infinispan/infinispan
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
RemoteCacheManager.getCache
@Override public <K, V> RemoteCache<K, V> getCache() { return getCache(configuration.forceReturnValues()); }
java
@Override public <K, V> RemoteCache<K, V> getCache() { return getCache(configuration.forceReturnValues()); }
[ "@", "Override", "public", "<", "K", ",", "V", ">", "RemoteCache", "<", "K", ",", "V", ">", "getCache", "(", ")", "{", "return", "getCache", "(", "configuration", ".", "forceReturnValues", "(", ")", ")", ";", "}" ]
Retrieves the default cache from the remote server. @return a remote cache instance that can be used to send requests to the default cache in the server
[ "Retrieves", "the", "default", "cache", "from", "the", "remote", "server", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java#L248-L251
29,749
infinispan/infinispan
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
RemoteCacheManager.stop
@Override public void stop() { if (isStarted()) { log.debugf("Stopping remote cache manager %x", System.identityHashCode(this)); synchronized (cacheName2RemoteCache) { for(Map.Entry<RemoteCacheKey, RemoteCacheHolder> cache : cacheName2RemoteCache.entrySet()) { cache.getValue().remoteCache().stop(); } cacheName2RemoteCache.clear(); } listenerNotifier.stop(); counterManager.stop(); channelFactory.destroy(); } unregisterMBean(); started = false; }
java
@Override public void stop() { if (isStarted()) { log.debugf("Stopping remote cache manager %x", System.identityHashCode(this)); synchronized (cacheName2RemoteCache) { for(Map.Entry<RemoteCacheKey, RemoteCacheHolder> cache : cacheName2RemoteCache.entrySet()) { cache.getValue().remoteCache().stop(); } cacheName2RemoteCache.clear(); } listenerNotifier.stop(); counterManager.stop(); channelFactory.destroy(); } unregisterMBean(); started = false; }
[ "@", "Override", "public", "void", "stop", "(", ")", "{", "if", "(", "isStarted", "(", ")", ")", "{", "log", ".", "debugf", "(", "\"Stopping remote cache manager %x\"", ",", "System", ".", "identityHashCode", "(", "this", ")", ")", ";", "synchronized", "("...
Stop the remote cache manager, disconnecting all existing connections. As part of the disconnection, all registered client cache listeners will be removed since client no longer can receive callbacks.
[ "Stop", "the", "remote", "cache", "manager", "disconnecting", "all", "existing", "connections", ".", "As", "part", "of", "the", "disconnection", "all", "registered", "client", "cache", "listeners", "will", "be", "removed", "since", "client", "no", "longer", "can...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java#L353-L369
29,750
infinispan/infinispan
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
RemoteCacheManager.initRemoteCache
private void initRemoteCache(RemoteCacheImpl remoteCache, OperationsFactory operationsFactory) { if (configuration.statistics().jmxEnabled()) { remoteCache.init(marshaller, operationsFactory, configuration.keySizeEstimate(), configuration.valueSizeEstimate(), configuration.batchSize(), mbeanObjectName); } else { remoteCache.init(marshaller, operationsFactory, configuration.keySizeEstimate(), configuration.valueSizeEstimate(), configuration.batchSize()); } }
java
private void initRemoteCache(RemoteCacheImpl remoteCache, OperationsFactory operationsFactory) { if (configuration.statistics().jmxEnabled()) { remoteCache.init(marshaller, operationsFactory, configuration.keySizeEstimate(), configuration.valueSizeEstimate(), configuration.batchSize(), mbeanObjectName); } else { remoteCache.init(marshaller, operationsFactory, configuration.keySizeEstimate(), configuration.valueSizeEstimate(), configuration.batchSize()); } }
[ "private", "void", "initRemoteCache", "(", "RemoteCacheImpl", "remoteCache", ",", "OperationsFactory", "operationsFactory", ")", "{", "if", "(", "configuration", ".", "statistics", "(", ")", ".", "jmxEnabled", "(", ")", ")", "{", "remoteCache", ".", "init", "(",...
Method that handles cache initialization - needed as a placeholder
[ "Method", "that", "handles", "cache", "initialization", "-", "needed", "as", "a", "placeholder" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java#L465-L473
29,751
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/util/InfinispanCollections.java
InfinispanCollections.difference
public static <E> Set<E> difference(Set<? extends E> s1, Set<? extends E> s2) { Set<E> copy1 = new HashSet<>(s1); copy1.removeAll(new HashSet<>(s2)); return copy1; }
java
public static <E> Set<E> difference(Set<? extends E> s1, Set<? extends E> s2) { Set<E> copy1 = new HashSet<>(s1); copy1.removeAll(new HashSet<>(s2)); return copy1; }
[ "public", "static", "<", "E", ">", "Set", "<", "E", ">", "difference", "(", "Set", "<", "?", "extends", "E", ">", "s1", ",", "Set", "<", "?", "extends", "E", ">", "s2", ")", "{", "Set", "<", "E", ">", "copy1", "=", "new", "HashSet", "<>", "("...
Returns the elements that are present in s1 but which are not present in s2, without changing the contents of neither s1, nor s2. @param s1 first set @param s2 second set @param <E> type of objects in Set @return the elements in s1 that are not in s2
[ "Returns", "the", "elements", "that", "are", "present", "in", "s1", "but", "which", "are", "not", "present", "in", "s2", "without", "changing", "the", "contents", "of", "neither", "s1", "nor", "s2", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/InfinispanCollections.java#L125-L129
29,752
infinispan/infinispan
core/src/main/java/org/infinispan/factories/ComponentRegistry.java
ComponentRegistry.cacheComponents
public void cacheComponents() { stateTransferManager = basicComponentRegistry.getComponent(StateTransferManager.class).wired(); responseGenerator = basicComponentRegistry.getComponent(ResponseGenerator.class).wired(); commandsFactory = basicComponentRegistry.getComponent(CommandsFactory.class).wired(); stateTransferLock = basicComponentRegistry.getComponent(StateTransferLock.class).wired(); inboundInvocationHandler = basicComponentRegistry.getComponent(PerCacheInboundInvocationHandler.class).wired(); versionGenerator = basicComponentRegistry.getComponent(VersionGenerator.class).wired(); distributionManager = basicComponentRegistry.getComponent(DistributionManager.class).wired(); // Initialize components that don't have any strong references from the cache basicComponentRegistry.getComponent(ClusterCacheStats.class); basicComponentRegistry.getComponent(CacheConfigurationMBean.class); basicComponentRegistry.getComponent(InternalConflictManager.class); basicComponentRegistry.getComponent(LocalStreamManager.class); basicComponentRegistry.getComponent(ClusterStreamManager.class); basicComponentRegistry.getComponent(ClusterPublisherManager.class); basicComponentRegistry.getComponent(XSiteStateTransferManager.class); basicComponentRegistry.getComponent(BackupSender.class); basicComponentRegistry.getComponent(StateTransferManager.class); basicComponentRegistry.getComponent(StateReceiver.class); basicComponentRegistry.getComponent(PreloadManager.class); }
java
public void cacheComponents() { stateTransferManager = basicComponentRegistry.getComponent(StateTransferManager.class).wired(); responseGenerator = basicComponentRegistry.getComponent(ResponseGenerator.class).wired(); commandsFactory = basicComponentRegistry.getComponent(CommandsFactory.class).wired(); stateTransferLock = basicComponentRegistry.getComponent(StateTransferLock.class).wired(); inboundInvocationHandler = basicComponentRegistry.getComponent(PerCacheInboundInvocationHandler.class).wired(); versionGenerator = basicComponentRegistry.getComponent(VersionGenerator.class).wired(); distributionManager = basicComponentRegistry.getComponent(DistributionManager.class).wired(); // Initialize components that don't have any strong references from the cache basicComponentRegistry.getComponent(ClusterCacheStats.class); basicComponentRegistry.getComponent(CacheConfigurationMBean.class); basicComponentRegistry.getComponent(InternalConflictManager.class); basicComponentRegistry.getComponent(LocalStreamManager.class); basicComponentRegistry.getComponent(ClusterStreamManager.class); basicComponentRegistry.getComponent(ClusterPublisherManager.class); basicComponentRegistry.getComponent(XSiteStateTransferManager.class); basicComponentRegistry.getComponent(BackupSender.class); basicComponentRegistry.getComponent(StateTransferManager.class); basicComponentRegistry.getComponent(StateReceiver.class); basicComponentRegistry.getComponent(PreloadManager.class); }
[ "public", "void", "cacheComponents", "(", ")", "{", "stateTransferManager", "=", "basicComponentRegistry", ".", "getComponent", "(", "StateTransferManager", ".", "class", ")", ".", "wired", "(", ")", ";", "responseGenerator", "=", "basicComponentRegistry", ".", "get...
Invoked last after all services are wired
[ "Invoked", "last", "after", "all", "services", "are", "wired" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/factories/ComponentRegistry.java#L298-L319
29,753
infinispan/infinispan
core/src/main/java/org/infinispan/stream/impl/DistributedCacheStream.java
DistributedCacheStream.filter
@Override public CacheStream<R> filter(Predicate<? super R> predicate) { return addIntermediateOperation(new FilterOperation<>(predicate)); }
java
@Override public CacheStream<R> filter(Predicate<? super R> predicate) { return addIntermediateOperation(new FilterOperation<>(predicate)); }
[ "@", "Override", "public", "CacheStream", "<", "R", ">", "filter", "(", "Predicate", "<", "?", "super", "R", ">", "predicate", ")", "{", "return", "addIntermediateOperation", "(", "new", "FilterOperation", "<>", "(", "predicate", ")", ")", ";", "}" ]
Intermediate operations that are stored for lazy evalulation
[ "Intermediate", "operations", "that", "are", "stored", "for", "lazy", "evalulation" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/stream/impl/DistributedCacheStream.java#L164-L167
29,754
infinispan/infinispan
core/src/main/java/org/infinispan/stream/impl/DistributedCacheStream.java
DistributedCacheStream.reduce
@Override public R reduce(R identity, BinaryOperator<R> accumulator) { return performOperation(TerminalFunctions.reduceFunction(identity, accumulator), true, accumulator, null); }
java
@Override public R reduce(R identity, BinaryOperator<R> accumulator) { return performOperation(TerminalFunctions.reduceFunction(identity, accumulator), true, accumulator, null); }
[ "@", "Override", "public", "R", "reduce", "(", "R", "identity", ",", "BinaryOperator", "<", "R", ">", "accumulator", ")", "{", "return", "performOperation", "(", "TerminalFunctions", ".", "reduceFunction", "(", "identity", ",", "accumulator", ")", ",", "true",...
Now we have terminal operators
[ "Now", "we", "have", "terminal", "operators" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/stream/impl/DistributedCacheStream.java#L269-L272
29,755
infinispan/infinispan
core/src/main/java/org/infinispan/stream/impl/DistributedCacheStream.java
DistributedCacheStream.iterator
@Override public Iterator<R> iterator() { log.tracef("Distributed iterator invoked with rehash: %s", rehashAware); if (!rehashAware) { // Non rehash doesn't care about lost segments or completed ones CloseableIterator<R> closeableIterator = nonRehashRemoteIterator(dm.getReadConsistentHash(), segmentsToFilter, null, IdentityPublisherDecorator.getInstance(), intermediateOperations); onClose(closeableIterator::close); return closeableIterator; } else { Iterable<IntermediateOperation> ops = iteratorOperation.prepareForIteration(intermediateOperations, (Function) nonNullKeyFunction()); CloseableIterator<R> closeableIterator; if (segmentCompletionListener != null && iteratorOperation != IteratorOperation.FLAT_MAP) { closeableIterator = new CompletionListenerRehashIterator<>(ops, segmentCompletionListener); } else { closeableIterator = new RehashIterator<>(ops); } onClose(closeableIterator::close); // This cast messes up generic checking, but that is okay Function<R, R> function = iteratorOperation.getFunction(); if (function != null) { return new IteratorMapper<>(closeableIterator, function); } else { return closeableIterator; } } }
java
@Override public Iterator<R> iterator() { log.tracef("Distributed iterator invoked with rehash: %s", rehashAware); if (!rehashAware) { // Non rehash doesn't care about lost segments or completed ones CloseableIterator<R> closeableIterator = nonRehashRemoteIterator(dm.getReadConsistentHash(), segmentsToFilter, null, IdentityPublisherDecorator.getInstance(), intermediateOperations); onClose(closeableIterator::close); return closeableIterator; } else { Iterable<IntermediateOperation> ops = iteratorOperation.prepareForIteration(intermediateOperations, (Function) nonNullKeyFunction()); CloseableIterator<R> closeableIterator; if (segmentCompletionListener != null && iteratorOperation != IteratorOperation.FLAT_MAP) { closeableIterator = new CompletionListenerRehashIterator<>(ops, segmentCompletionListener); } else { closeableIterator = new RehashIterator<>(ops); } onClose(closeableIterator::close); // This cast messes up generic checking, but that is okay Function<R, R> function = iteratorOperation.getFunction(); if (function != null) { return new IteratorMapper<>(closeableIterator, function); } else { return closeableIterator; } } }
[ "@", "Override", "public", "Iterator", "<", "R", ">", "iterator", "(", ")", "{", "log", ".", "tracef", "(", "\"Distributed iterator invoked with rehash: %s\"", ",", "rehashAware", ")", ";", "if", "(", "!", "rehashAware", ")", "{", "// Non rehash doesn't care about...
The next ones are key tracking terminal operators
[ "The", "next", "ones", "are", "key", "tracking", "terminal", "operators" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/stream/impl/DistributedCacheStream.java#L451-L478
29,756
infinispan/infinispan
remote-query/remote-query-server/src/main/java/org/infinispan/query/remote/impl/ProtobufMetadataManagerImpl.java
ProtobufMetadataManagerImpl.getProtobufMetadataManager
private static ProtobufMetadataManagerImpl getProtobufMetadataManager(EmbeddedCacheManager cacheManager) { if (cacheManager == null) { throw new IllegalArgumentException("cacheManager cannot be null"); } ProtobufMetadataManagerImpl metadataManager = (ProtobufMetadataManagerImpl) cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class); if (metadataManager == null) { throw new IllegalStateException("ProtobufMetadataManager not initialised yet!"); } return metadataManager; }
java
private static ProtobufMetadataManagerImpl getProtobufMetadataManager(EmbeddedCacheManager cacheManager) { if (cacheManager == null) { throw new IllegalArgumentException("cacheManager cannot be null"); } ProtobufMetadataManagerImpl metadataManager = (ProtobufMetadataManagerImpl) cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class); if (metadataManager == null) { throw new IllegalStateException("ProtobufMetadataManager not initialised yet!"); } return metadataManager; }
[ "private", "static", "ProtobufMetadataManagerImpl", "getProtobufMetadataManager", "(", "EmbeddedCacheManager", "cacheManager", ")", "{", "if", "(", "cacheManager", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"cacheManager cannot be null\"", ")...
Obtains the ProtobufMetadataManagerImpl instance associated to a cache manager. @param cacheManager a cache manager instance @return the ProtobufMetadataManagerImpl instance associated to a cache manager.
[ "Obtains", "the", "ProtobufMetadataManagerImpl", "instance", "associated", "to", "a", "cache", "manager", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/remote-query/remote-query-server/src/main/java/org/infinispan/query/remote/impl/ProtobufMetadataManagerImpl.java#L245-L254
29,757
infinispan/infinispan
core/src/main/java/org/infinispan/container/impl/InternalEntryFactoryImpl.java
InternalEntryFactoryImpl.isStoreMetadata
public static boolean isStoreMetadata(Metadata metadata, InternalCacheEntry ice) { return metadata != null && (ice == null || isEntryMetadataAware(ice)) && (metadata.version() != null || !(metadata instanceof EmbeddedMetadata)); }
java
public static boolean isStoreMetadata(Metadata metadata, InternalCacheEntry ice) { return metadata != null && (ice == null || isEntryMetadataAware(ice)) && (metadata.version() != null || !(metadata instanceof EmbeddedMetadata)); }
[ "public", "static", "boolean", "isStoreMetadata", "(", "Metadata", "metadata", ",", "InternalCacheEntry", "ice", ")", "{", "return", "metadata", "!=", "null", "&&", "(", "ice", "==", "null", "||", "isEntryMetadataAware", "(", "ice", ")", ")", "&&", "(", "met...
Indicates whether the entire metadata object needs to be stored or not. This check is done to avoid keeping the entire metadata object around when only lifespan or maxIdle time is stored. If more information needs to be stored (i.e. version), or the metadata object is not the embedded one, keep the entire metadata object around. @return true if the entire metadata object needs to be stored, otherwise simply store lifespan and/or maxIdle in existing cache entries
[ "Indicates", "whether", "the", "entire", "metadata", "object", "needs", "to", "be", "stored", "or", "not", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/container/impl/InternalEntryFactoryImpl.java#L387-L392
29,758
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/configuration/attributes/AttributeSet.java
AttributeSet.attribute
@SuppressWarnings("unchecked") public <T> Attribute<T> attribute(String name) { return (Attribute<T>) this.attributes.get(name); }
java
@SuppressWarnings("unchecked") public <T> Attribute<T> attribute(String name) { return (Attribute<T>) this.attributes.get(name); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "Attribute", "<", "T", ">", "attribute", "(", "String", "name", ")", "{", "return", "(", "Attribute", "<", "T", ">", ")", "this", ".", "attributes", ".", "get", "(", "name", ...
Returns the named attribute @param name the name of the attribute to return @return the attribute
[ "Returns", "the", "named", "attribute" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/configuration/attributes/AttributeSet.java#L97-L100
29,759
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/configuration/attributes/AttributeSet.java
AttributeSet.read
public void read(AttributeSet other) { for (Iterator<Attribute<?>> iterator = attributes.values().iterator(); iterator.hasNext();) { Attribute<Object> attribute = (Attribute<Object>) iterator.next(); Attribute<Object> a = other.attribute(attribute.name()); if (a.isModified()) { attribute.read(a); } } }
java
public void read(AttributeSet other) { for (Iterator<Attribute<?>> iterator = attributes.values().iterator(); iterator.hasNext();) { Attribute<Object> attribute = (Attribute<Object>) iterator.next(); Attribute<Object> a = other.attribute(attribute.name()); if (a.isModified()) { attribute.read(a); } } }
[ "public", "void", "read", "(", "AttributeSet", "other", ")", "{", "for", "(", "Iterator", "<", "Attribute", "<", "?", ">", ">", "iterator", "=", "attributes", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", "...
Copies all attribute from another AttributeSet @param other the source AttributeSet
[ "Copies", "all", "attribute", "from", "another", "AttributeSet" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/configuration/attributes/AttributeSet.java#L120-L130
29,760
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/configuration/attributes/AttributeSet.java
AttributeSet.write
public void write(XMLStreamWriter writer, String xmlElementName) throws XMLStreamException { if (isModified()) { writer.writeStartElement(xmlElementName); write(writer); writer.writeEndElement(); } }
java
public void write(XMLStreamWriter writer, String xmlElementName) throws XMLStreamException { if (isModified()) { writer.writeStartElement(xmlElementName); write(writer); writer.writeEndElement(); } }
[ "public", "void", "write", "(", "XMLStreamWriter", "writer", ",", "String", "xmlElementName", ")", "throws", "XMLStreamException", "{", "if", "(", "isModified", "(", ")", ")", "{", "writer", ".", "writeStartElement", "(", "xmlElementName", ")", ";", "write", "...
Writes this attributeset to the specified XMLStreamWriter as an element @param writer
[ "Writes", "this", "attributeset", "to", "the", "specified", "XMLStreamWriter", "as", "an", "element" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/configuration/attributes/AttributeSet.java#L209-L215
29,761
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/configuration/attributes/AttributeSet.java
AttributeSet.write
public void write(XMLStreamWriter writer, String xmlElementName, AttributeDefinition<?>... defs) throws XMLStreamException { boolean skip = true; for (AttributeDefinition def : defs) { skip = skip && !attribute(def).isModified(); } if (!skip) { writer.writeStartElement(xmlElementName); for (AttributeDefinition def : defs) { Attribute attr = attribute(def); attr.write(writer, attr.getAttributeDefinition().xmlName()); } writer.writeEndElement(); } }
java
public void write(XMLStreamWriter writer, String xmlElementName, AttributeDefinition<?>... defs) throws XMLStreamException { boolean skip = true; for (AttributeDefinition def : defs) { skip = skip && !attribute(def).isModified(); } if (!skip) { writer.writeStartElement(xmlElementName); for (AttributeDefinition def : defs) { Attribute attr = attribute(def); attr.write(writer, attr.getAttributeDefinition().xmlName()); } writer.writeEndElement(); } }
[ "public", "void", "write", "(", "XMLStreamWriter", "writer", ",", "String", "xmlElementName", ",", "AttributeDefinition", "<", "?", ">", "...", "defs", ")", "throws", "XMLStreamException", "{", "boolean", "skip", "=", "true", ";", "for", "(", "AttributeDefinitio...
Writes the specified attributes in this attributeset to the specified XMLStreamWriter as an element @param writer
[ "Writes", "the", "specified", "attributes", "in", "this", "attributeset", "to", "the", "specified", "XMLStreamWriter", "as", "an", "element" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/configuration/attributes/AttributeSet.java#L221-L234
29,762
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/configuration/attributes/AttributeSet.java
AttributeSet.write
public void write(XMLStreamWriter writer) throws XMLStreamException { for (Attribute<?> attr : attributes.values()) { if (attr.isPersistent()) attr.write(writer, attr.getAttributeDefinition().xmlName()); } }
java
public void write(XMLStreamWriter writer) throws XMLStreamException { for (Attribute<?> attr : attributes.values()) { if (attr.isPersistent()) attr.write(writer, attr.getAttributeDefinition().xmlName()); } }
[ "public", "void", "write", "(", "XMLStreamWriter", "writer", ")", "throws", "XMLStreamException", "{", "for", "(", "Attribute", "<", "?", ">", "attr", ":", "attributes", ".", "values", "(", ")", ")", "{", "if", "(", "attr", ".", "isPersistent", "(", ")",...
Writes the attributes of this attributeset as part of the current element @param writer
[ "Writes", "the", "attributes", "of", "this", "attributeset", "as", "part", "of", "the", "current", "element" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/configuration/attributes/AttributeSet.java#L240-L245
29,763
infinispan/infinispan
lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/InfinispanIndexInput.java
InfinispanIndexInput.setBufferToCurrentChunkIfPossible
private void setBufferToCurrentChunkIfPossible() { ChunkCacheKey key = new ChunkCacheKey(fileKey.getIndexName(), filename, currentLoadedChunk, chunkSize, affinitySegmentId); buffer = (byte[]) chunksCache.get(key); if (buffer == null) { currentLoadedChunk--; bufferPosition = chunkSize; } else { currentBufferSize = buffer.length; } }
java
private void setBufferToCurrentChunkIfPossible() { ChunkCacheKey key = new ChunkCacheKey(fileKey.getIndexName(), filename, currentLoadedChunk, chunkSize, affinitySegmentId); buffer = (byte[]) chunksCache.get(key); if (buffer == null) { currentLoadedChunk--; bufferPosition = chunkSize; } else { currentBufferSize = buffer.length; } }
[ "private", "void", "setBufferToCurrentChunkIfPossible", "(", ")", "{", "ChunkCacheKey", "key", "=", "new", "ChunkCacheKey", "(", "fileKey", ".", "getIndexName", "(", ")", ",", "filename", ",", "currentLoadedChunk", ",", "chunkSize", ",", "affinitySegmentId", ")", ...
RAMDirectory teaches to position the cursor to the end of previous chunk in this case
[ "RAMDirectory", "teaches", "to", "position", "the", "cursor", "to", "the", "end", "of", "previous", "chunk", "in", "this", "case" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/InfinispanIndexInput.java#L141-L151
29,764
infinispan/infinispan
lucene/lucene-directory/src/main/java/org/infinispan/lucene/directory/DirectoryBuilder.java
DirectoryBuilder.newDirectoryInstance
public static BuildContext newDirectoryInstance(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, Cache<?, ?> distLocksCache, String indexName) { validateIndexCaches(indexName, metadataCache, chunksCache, distLocksCache); return new DirectoryBuilderImpl(metadataCache, chunksCache, distLocksCache, indexName); }
java
public static BuildContext newDirectoryInstance(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, Cache<?, ?> distLocksCache, String indexName) { validateIndexCaches(indexName, metadataCache, chunksCache, distLocksCache); return new DirectoryBuilderImpl(metadataCache, chunksCache, distLocksCache, indexName); }
[ "public", "static", "BuildContext", "newDirectoryInstance", "(", "Cache", "<", "?", ",", "?", ">", "metadataCache", ",", "Cache", "<", "?", ",", "?", ">", "chunksCache", ",", "Cache", "<", "?", ",", "?", ">", "distLocksCache", ",", "String", "indexName", ...
Starting point to create a Directory instance. @param metadataCache contains the metadata of stored elements @param chunksCache cache containing the bulk of the index; this is the larger part of data @param distLocksCache cache to store locks; should be replicated and not using a persistent CacheStore @param indexName identifies the index; you can store different indexes in the same set of caches using different identifiers
[ "Starting", "point", "to", "create", "a", "Directory", "instance", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/directory/DirectoryBuilder.java#L35-L38
29,765
infinispan/infinispan
server/integration/commons/src/main/java/org/infinispan/server/commons/features/Feature.java
Feature.isAvailableOrThrowException
public static Features isAvailableOrThrowException(Features features, String feature, ClassLoader classLoader) { if (features == null) { features = new Features(classLoader); } isAvailableOrThrowException(features, feature); return features; }
java
public static Features isAvailableOrThrowException(Features features, String feature, ClassLoader classLoader) { if (features == null) { features = new Features(classLoader); } isAvailableOrThrowException(features, feature); return features; }
[ "public", "static", "Features", "isAvailableOrThrowException", "(", "Features", "features", ",", "String", "feature", ",", "ClassLoader", "classLoader", ")", "{", "if", "(", "features", "==", "null", ")", "{", "features", "=", "new", "Features", "(", "classLoade...
Verify that the specified feature is enabled. Initializes features if the provided one is null, allowing for lazily initialized Features instance. @param features existing instance or null. @param feature the feature string to check. @param classLoader to create the {@link Features} instance with if it doesn't already exist. @return the features instance that was checked, always non null @throws org.infinispan.commons.CacheConfigurationException thrown if the feature was disabled
[ "Verify", "that", "the", "specified", "feature", "is", "enabled", ".", "Initializes", "features", "if", "the", "provided", "one", "is", "null", "allowing", "for", "lazily", "initialized", "Features", "instance", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/commons/src/main/java/org/infinispan/server/commons/features/Feature.java#L20-L26
29,766
infinispan/infinispan
persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java
TableManipulationConfigurationBuilder.idColumnName
public S idColumnName(String idColumnName) { attributes.attribute(ID_COLUMN_NAME).set(idColumnName); return self(); }
java
public S idColumnName(String idColumnName) { attributes.attribute(ID_COLUMN_NAME).set(idColumnName); return self(); }
[ "public", "S", "idColumnName", "(", "String", "idColumnName", ")", "{", "attributes", ".", "attribute", "(", "ID_COLUMN_NAME", ")", ".", "set", "(", "idColumnName", ")", ";", "return", "self", "(", ")", ";", "}" ]
The name of the database column used to store the keys
[ "The", "name", "of", "the", "database", "column", "used", "to", "store", "the", "keys" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java#L106-L109
29,767
infinispan/infinispan
persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java
TableManipulationConfigurationBuilder.idColumnType
public S idColumnType(String idColumnType) { attributes.attribute(ID_COLUMN_TYPE).set(idColumnType); return self(); }
java
public S idColumnType(String idColumnType) { attributes.attribute(ID_COLUMN_TYPE).set(idColumnType); return self(); }
[ "public", "S", "idColumnType", "(", "String", "idColumnType", ")", "{", "attributes", ".", "attribute", "(", "ID_COLUMN_TYPE", ")", ".", "set", "(", "idColumnType", ")", ";", "return", "self", "(", ")", ";", "}" ]
The type of the database column used to store the keys
[ "The", "type", "of", "the", "database", "column", "used", "to", "store", "the", "keys" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java#L114-L117
29,768
infinispan/infinispan
persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java
TableManipulationConfigurationBuilder.dataColumnName
public S dataColumnName(String dataColumnName) { attributes.attribute(DATA_COLUMN_NAME).set(dataColumnName); return self(); }
java
public S dataColumnName(String dataColumnName) { attributes.attribute(DATA_COLUMN_NAME).set(dataColumnName); return self(); }
[ "public", "S", "dataColumnName", "(", "String", "dataColumnName", ")", "{", "attributes", ".", "attribute", "(", "DATA_COLUMN_NAME", ")", ".", "set", "(", "dataColumnName", ")", ";", "return", "self", "(", ")", ";", "}" ]
The name of the database column used to store the entries
[ "The", "name", "of", "the", "database", "column", "used", "to", "store", "the", "entries" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java#L122-L125
29,769
infinispan/infinispan
persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java
TableManipulationConfigurationBuilder.dataColumnType
public S dataColumnType(String dataColumnType) { attributes.attribute(DATA_COLUMN_TYPE).set(dataColumnType); return self(); }
java
public S dataColumnType(String dataColumnType) { attributes.attribute(DATA_COLUMN_TYPE).set(dataColumnType); return self(); }
[ "public", "S", "dataColumnType", "(", "String", "dataColumnType", ")", "{", "attributes", ".", "attribute", "(", "DATA_COLUMN_TYPE", ")", ".", "set", "(", "dataColumnType", ")", ";", "return", "self", "(", ")", ";", "}" ]
The type of the database column used to store the entries
[ "The", "type", "of", "the", "database", "column", "used", "to", "store", "the", "entries" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java#L130-L133
29,770
infinispan/infinispan
persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java
TableManipulationConfigurationBuilder.timestampColumnName
public S timestampColumnName(String timestampColumnName) { attributes.attribute(TIMESTAMP_COLUMN_NAME).set(timestampColumnName); return self(); }
java
public S timestampColumnName(String timestampColumnName) { attributes.attribute(TIMESTAMP_COLUMN_NAME).set(timestampColumnName); return self(); }
[ "public", "S", "timestampColumnName", "(", "String", "timestampColumnName", ")", "{", "attributes", ".", "attribute", "(", "TIMESTAMP_COLUMN_NAME", ")", ".", "set", "(", "timestampColumnName", ")", ";", "return", "self", "(", ")", ";", "}" ]
The name of the database column used to store the timestamps
[ "The", "name", "of", "the", "database", "column", "used", "to", "store", "the", "timestamps" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java#L138-L141
29,771
infinispan/infinispan
persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java
TableManipulationConfigurationBuilder.timestampColumnType
public S timestampColumnType(String timestampColumnType) { attributes.attribute(TIMESTAMP_COLUMN_TYPE).set(timestampColumnType); return self(); }
java
public S timestampColumnType(String timestampColumnType) { attributes.attribute(TIMESTAMP_COLUMN_TYPE).set(timestampColumnType); return self(); }
[ "public", "S", "timestampColumnType", "(", "String", "timestampColumnType", ")", "{", "attributes", ".", "attribute", "(", "TIMESTAMP_COLUMN_TYPE", ")", ".", "set", "(", "timestampColumnType", ")", ";", "return", "self", "(", ")", ";", "}" ]
The type of the database column used to store the timestamps
[ "The", "type", "of", "the", "database", "column", "used", "to", "store", "the", "timestamps" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java#L146-L149
29,772
infinispan/infinispan
persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java
TableManipulationConfigurationBuilder.segmentColumnName
public S segmentColumnName(String segmentColumnName) { attributes.attribute(SEGMENT_COLUMN_NAME).set(segmentColumnName); return self(); }
java
public S segmentColumnName(String segmentColumnName) { attributes.attribute(SEGMENT_COLUMN_NAME).set(segmentColumnName); return self(); }
[ "public", "S", "segmentColumnName", "(", "String", "segmentColumnName", ")", "{", "attributes", ".", "attribute", "(", "SEGMENT_COLUMN_NAME", ")", ".", "set", "(", "segmentColumnName", ")", ";", "return", "self", "(", ")", ";", "}" ]
The name of the database column used to store the segments
[ "The", "name", "of", "the", "database", "column", "used", "to", "store", "the", "segments" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java#L154-L157
29,773
infinispan/infinispan
persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java
TableManipulationConfigurationBuilder.segmentColumnType
public S segmentColumnType(String segmentColumnType) { attributes.attribute(SEGMENT_COLUMN_TYPE).set(segmentColumnType); return self(); }
java
public S segmentColumnType(String segmentColumnType) { attributes.attribute(SEGMENT_COLUMN_TYPE).set(segmentColumnType); return self(); }
[ "public", "S", "segmentColumnType", "(", "String", "segmentColumnType", ")", "{", "attributes", ".", "attribute", "(", "SEGMENT_COLUMN_TYPE", ")", ".", "set", "(", "segmentColumnType", ")", ";", "return", "self", "(", ")", ";", "}" ]
The type of the database column used to store the segments
[ "The", "type", "of", "the", "database", "column", "used", "to", "store", "the", "segments" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/configuration/TableManipulationConfigurationBuilder.java#L162-L165
29,774
infinispan/infinispan
core/src/main/java/org/infinispan/transaction/impl/TotalOrderRemoteTransactionState.java
TotalOrderRemoteTransactionState.waitUntilPrepared
public final synchronized boolean waitUntilPrepared(boolean commit) throws InterruptedException { boolean result; State state = commit ? State.COMMIT_ONLY : State.ROLLBACK_ONLY; if (trace) { log.tracef("[%s] Current status is %s, setting status to: %s", globalTransaction.globalId(), transactionState, state); } transactionState.add(state); if (transactionState.contains(State.PREPARED)) { result = true; if (trace) { log.tracef("[%s] Transaction is PREPARED", globalTransaction.globalId()); } } else if (transactionState.contains(State.PREPARING)) { wait(); result = true; if (trace) { log.tracef("[%s] Transaction was in PREPARING state but now it is prepared", globalTransaction.globalId()); } } else { if (trace) { log.tracef("[%s] Transaction is not delivered yet", globalTransaction.globalId()); } result = false; } return result; }
java
public final synchronized boolean waitUntilPrepared(boolean commit) throws InterruptedException { boolean result; State state = commit ? State.COMMIT_ONLY : State.ROLLBACK_ONLY; if (trace) { log.tracef("[%s] Current status is %s, setting status to: %s", globalTransaction.globalId(), transactionState, state); } transactionState.add(state); if (transactionState.contains(State.PREPARED)) { result = true; if (trace) { log.tracef("[%s] Transaction is PREPARED", globalTransaction.globalId()); } } else if (transactionState.contains(State.PREPARING)) { wait(); result = true; if (trace) { log.tracef("[%s] Transaction was in PREPARING state but now it is prepared", globalTransaction.globalId()); } } else { if (trace) { log.tracef("[%s] Transaction is not delivered yet", globalTransaction.globalId()); } result = false; } return result; }
[ "public", "final", "synchronized", "boolean", "waitUntilPrepared", "(", "boolean", "commit", ")", "throws", "InterruptedException", "{", "boolean", "result", ";", "State", "state", "=", "commit", "?", "State", ".", "COMMIT_ONLY", ":", "State", ".", "ROLLBACK_ONLY"...
Commit and rollback commands invokes this method and they are blocked here if the state is PREPARING @param commit true if it is a commit command, false otherwise @return true if the command needs to be processed, false otherwise @throws InterruptedException when it is interrupted while waiting
[ "Commit", "and", "rollback", "commands", "invokes", "this", "method", "and", "they", "are", "blocked", "here", "if", "the", "state", "is", "PREPARING" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/transaction/impl/TotalOrderRemoteTransactionState.java#L85-L114
29,775
infinispan/infinispan
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/event/impl/ContinuousQueryImpl.java
ContinuousQueryImpl.addContinuousQueryListener
public <C> void addContinuousQueryListener(Query query, ContinuousQueryListener<K, C> listener) { addContinuousQueryListener(query.getQueryString(), query.getParameters(), listener); }
java
public <C> void addContinuousQueryListener(Query query, ContinuousQueryListener<K, C> listener) { addContinuousQueryListener(query.getQueryString(), query.getParameters(), listener); }
[ "public", "<", "C", ">", "void", "addContinuousQueryListener", "(", "Query", "query", ",", "ContinuousQueryListener", "<", "K", ",", "C", ">", "listener", ")", "{", "addContinuousQueryListener", "(", "query", ".", "getQueryString", "(", ")", ",", "query", ".",...
Registers a continuous query listener that uses a query DSL based filter. The listener will receive notifications when a cache entry joins or leaves the matching set defined by the query. @param listener the continuous query listener instance @param query the query to be used for determining the matching set
[ "Registers", "a", "continuous", "query", "listener", "that", "uses", "a", "query", "DSL", "based", "filter", ".", "The", "listener", "will", "receive", "notifications", "when", "a", "cache", "entry", "joins", "or", "leaves", "the", "matching", "set", "defined"...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/event/impl/ContinuousQueryImpl.java#L68-L70
29,776
infinispan/infinispan
jcache/embedded/src/main/java/org/infinispan/jcache/annotation/CacheKeyInvocationContextFactory.java
CacheKeyInvocationContextFactory.getCacheKeyInvocationContext
public <A extends Annotation> CacheKeyInvocationContext<A> getCacheKeyInvocationContext(InvocationContext invocationContext) { assertNotNull(invocationContext, "invocationContext parameter must not be null"); final MethodMetaData<A> methodMetaData = (MethodMetaData<A>) getMethodMetaData(invocationContext.getMethod()); return new CacheKeyInvocationContextImpl<A>(invocationContext, methodMetaData); }
java
public <A extends Annotation> CacheKeyInvocationContext<A> getCacheKeyInvocationContext(InvocationContext invocationContext) { assertNotNull(invocationContext, "invocationContext parameter must not be null"); final MethodMetaData<A> methodMetaData = (MethodMetaData<A>) getMethodMetaData(invocationContext.getMethod()); return new CacheKeyInvocationContextImpl<A>(invocationContext, methodMetaData); }
[ "public", "<", "A", "extends", "Annotation", ">", "CacheKeyInvocationContext", "<", "A", ">", "getCacheKeyInvocationContext", "(", "InvocationContext", "invocationContext", ")", "{", "assertNotNull", "(", "invocationContext", ",", "\"invocationContext parameter must not be nu...
Returns the cache key invocation context corresponding to the given invocation context. @param invocationContext the {@link javax.interceptor.InvocationContext}. @return an instance of {@link javax.cache.annotation.CacheKeyInvocationContext} corresponding to the given {@link javax.interceptor.InvocationContext}.
[ "Returns", "the", "cache", "key", "invocation", "context", "corresponding", "to", "the", "given", "invocation", "context", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/jcache/embedded/src/main/java/org/infinispan/jcache/annotation/CacheKeyInvocationContextFactory.java#L61-L66
29,777
infinispan/infinispan
jcache/embedded/src/main/java/org/infinispan/jcache/annotation/CacheKeyInvocationContextFactory.java
CacheKeyInvocationContextFactory.getMethodMetaData
private MethodMetaData<? extends Annotation> getMethodMetaData(Method method) { MethodMetaData<? extends Annotation> methodMetaData = methodMetaDataCache.get(method); if (methodMetaData == null) { final String cacheName; final Annotation cacheAnnotation; final AggregatedParameterMetaData aggregatedParameterMetaData; final CacheKeyGenerator cacheKeyGenerator; final CacheDefaults cacheDefaultsAnnotation = method.getDeclaringClass().getAnnotation(CacheDefaults.class); if (method.isAnnotationPresent(CacheResult.class)) { final CacheResult cacheResultAnnotation = method.getAnnotation(CacheResult.class); cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation); cacheName = getCacheName(method, cacheResultAnnotation.cacheName(), cacheDefaultsAnnotation, true); aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false); cacheAnnotation = cacheResultAnnotation; } else if (method.isAnnotationPresent(CacheRemove.class)) { final CacheRemove cacheRemoveEntryAnnotation = method.getAnnotation(CacheRemove.class); cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheRemoveEntryAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation); cacheName = getCacheName(method, cacheRemoveEntryAnnotation.cacheName(), cacheDefaultsAnnotation, false); aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false); cacheAnnotation = cacheRemoveEntryAnnotation; if (cacheName.isEmpty()) { throw log.cacheRemoveEntryMethodWithoutCacheName(method.getName()); } } else if (method.isAnnotationPresent(CacheRemoveAll.class)) { final CacheRemoveAll cacheRemoveAllAnnotation = method.getAnnotation(CacheRemoveAll.class); cacheKeyGenerator = null; cacheName = getCacheName(method, cacheRemoveAllAnnotation.cacheName(), cacheDefaultsAnnotation, false); aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false); cacheAnnotation = cacheRemoveAllAnnotation; if (cacheName.isEmpty()) { throw log.cacheRemoveAllMethodWithoutCacheName(method.getName()); } } else if (method.isAnnotationPresent(CachePut.class)) { final CachePut cachePutAnnotation = method.getAnnotation(CachePut.class); cacheKeyGenerator = getCacheKeyGenerator(beanManager, cachePutAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation); cacheName = getCacheName(method, cachePutAnnotation.cacheName(), cacheDefaultsAnnotation, true); aggregatedParameterMetaData = getAggregatedParameterMetaData(method, true); cacheAnnotation = cachePutAnnotation; } else { throw log.methodWithoutCacheAnnotation(method.getName()); } final MethodMetaData<? extends Annotation> newCacheMethodMetaData = new MethodMetaData<Annotation>( method, aggregatedParameterMetaData, asSet(method.getAnnotations()), cacheKeyGenerator, cacheAnnotation, cacheName ); methodMetaData = methodMetaDataCache.putIfAbsent(method, newCacheMethodMetaData); if (methodMetaData == null) { methodMetaData = newCacheMethodMetaData; } } return methodMetaData; }
java
private MethodMetaData<? extends Annotation> getMethodMetaData(Method method) { MethodMetaData<? extends Annotation> methodMetaData = methodMetaDataCache.get(method); if (methodMetaData == null) { final String cacheName; final Annotation cacheAnnotation; final AggregatedParameterMetaData aggregatedParameterMetaData; final CacheKeyGenerator cacheKeyGenerator; final CacheDefaults cacheDefaultsAnnotation = method.getDeclaringClass().getAnnotation(CacheDefaults.class); if (method.isAnnotationPresent(CacheResult.class)) { final CacheResult cacheResultAnnotation = method.getAnnotation(CacheResult.class); cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation); cacheName = getCacheName(method, cacheResultAnnotation.cacheName(), cacheDefaultsAnnotation, true); aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false); cacheAnnotation = cacheResultAnnotation; } else if (method.isAnnotationPresent(CacheRemove.class)) { final CacheRemove cacheRemoveEntryAnnotation = method.getAnnotation(CacheRemove.class); cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheRemoveEntryAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation); cacheName = getCacheName(method, cacheRemoveEntryAnnotation.cacheName(), cacheDefaultsAnnotation, false); aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false); cacheAnnotation = cacheRemoveEntryAnnotation; if (cacheName.isEmpty()) { throw log.cacheRemoveEntryMethodWithoutCacheName(method.getName()); } } else if (method.isAnnotationPresent(CacheRemoveAll.class)) { final CacheRemoveAll cacheRemoveAllAnnotation = method.getAnnotation(CacheRemoveAll.class); cacheKeyGenerator = null; cacheName = getCacheName(method, cacheRemoveAllAnnotation.cacheName(), cacheDefaultsAnnotation, false); aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false); cacheAnnotation = cacheRemoveAllAnnotation; if (cacheName.isEmpty()) { throw log.cacheRemoveAllMethodWithoutCacheName(method.getName()); } } else if (method.isAnnotationPresent(CachePut.class)) { final CachePut cachePutAnnotation = method.getAnnotation(CachePut.class); cacheKeyGenerator = getCacheKeyGenerator(beanManager, cachePutAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation); cacheName = getCacheName(method, cachePutAnnotation.cacheName(), cacheDefaultsAnnotation, true); aggregatedParameterMetaData = getAggregatedParameterMetaData(method, true); cacheAnnotation = cachePutAnnotation; } else { throw log.methodWithoutCacheAnnotation(method.getName()); } final MethodMetaData<? extends Annotation> newCacheMethodMetaData = new MethodMetaData<Annotation>( method, aggregatedParameterMetaData, asSet(method.getAnnotations()), cacheKeyGenerator, cacheAnnotation, cacheName ); methodMetaData = methodMetaDataCache.putIfAbsent(method, newCacheMethodMetaData); if (methodMetaData == null) { methodMetaData = newCacheMethodMetaData; } } return methodMetaData; }
[ "private", "MethodMetaData", "<", "?", "extends", "Annotation", ">", "getMethodMetaData", "(", "Method", "method", ")", "{", "MethodMetaData", "<", "?", "extends", "Annotation", ">", "methodMetaData", "=", "methodMetaDataCache", ".", "get", "(", "method", ")", "...
Returns the method meta data for the given method. @param method the method. @return an instance of {@link MethodMetaData}.
[ "Returns", "the", "method", "meta", "data", "for", "the", "given", "method", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/jcache/embedded/src/main/java/org/infinispan/jcache/annotation/CacheKeyInvocationContextFactory.java#L74-L140
29,778
infinispan/infinispan
jcache/embedded/src/main/java/org/infinispan/jcache/annotation/CacheKeyInvocationContextFactory.java
CacheKeyInvocationContextFactory.getAggregatedParameterMetaData
private AggregatedParameterMetaData getAggregatedParameterMetaData(Method method, boolean cacheValueAllowed) { final Class<?>[] parameterTypes = method.getParameterTypes(); final Annotation[][] parameterAnnotations = method.getParameterAnnotations(); final List<ParameterMetaData> parameters = new ArrayList<ParameterMetaData>(); final List<ParameterMetaData> keyParameters = new ArrayList<ParameterMetaData>(); ParameterMetaData valueParameter = null; for (int i = 0; i < parameterTypes.length; i++) { final Set<Annotation> annotations = asSet(parameterAnnotations[i]); final ParameterMetaData parameterMetaData = new ParameterMetaData(parameterTypes[i], i, annotations); for (Annotation oneAnnotation : annotations) { final Class<?> type = oneAnnotation.annotationType(); if (CacheKey.class.equals(type)) { keyParameters.add(parameterMetaData); } else if (cacheValueAllowed && CacheValue.class.equals(type)) { if (valueParameter != null) { throw log.cachePutMethodWithMoreThanOneCacheValueParameter(method.getName()); } valueParameter = parameterMetaData; } } parameters.add(parameterMetaData); } if (cacheValueAllowed && valueParameter == null) { if (parameters.size() > 1) { throw log.cachePutMethodWithoutCacheValueParameter(method.getName()); } valueParameter = parameters.get(0); } if (keyParameters.isEmpty()) { keyParameters.addAll(parameters); } if (valueParameter != null && keyParameters.size() > 1) { keyParameters.remove(valueParameter); } return new AggregatedParameterMetaData(parameters, keyParameters, valueParameter); }
java
private AggregatedParameterMetaData getAggregatedParameterMetaData(Method method, boolean cacheValueAllowed) { final Class<?>[] parameterTypes = method.getParameterTypes(); final Annotation[][] parameterAnnotations = method.getParameterAnnotations(); final List<ParameterMetaData> parameters = new ArrayList<ParameterMetaData>(); final List<ParameterMetaData> keyParameters = new ArrayList<ParameterMetaData>(); ParameterMetaData valueParameter = null; for (int i = 0; i < parameterTypes.length; i++) { final Set<Annotation> annotations = asSet(parameterAnnotations[i]); final ParameterMetaData parameterMetaData = new ParameterMetaData(parameterTypes[i], i, annotations); for (Annotation oneAnnotation : annotations) { final Class<?> type = oneAnnotation.annotationType(); if (CacheKey.class.equals(type)) { keyParameters.add(parameterMetaData); } else if (cacheValueAllowed && CacheValue.class.equals(type)) { if (valueParameter != null) { throw log.cachePutMethodWithMoreThanOneCacheValueParameter(method.getName()); } valueParameter = parameterMetaData; } } parameters.add(parameterMetaData); } if (cacheValueAllowed && valueParameter == null) { if (parameters.size() > 1) { throw log.cachePutMethodWithoutCacheValueParameter(method.getName()); } valueParameter = parameters.get(0); } if (keyParameters.isEmpty()) { keyParameters.addAll(parameters); } if (valueParameter != null && keyParameters.size() > 1) { keyParameters.remove(valueParameter); } return new AggregatedParameterMetaData(parameters, keyParameters, valueParameter); }
[ "private", "AggregatedParameterMetaData", "getAggregatedParameterMetaData", "(", "Method", "method", ",", "boolean", "cacheValueAllowed", ")", "{", "final", "Class", "<", "?", ">", "[", "]", "parameterTypes", "=", "method", ".", "getParameterTypes", "(", ")", ";", ...
Returns the aggregated parameter meta data for the given method. @param method the method. @param cacheValueAllowed {@code true} if the {@link javax.cache.annotation.CacheValue} annotation is allowed on a method parameter. @return an instance of {@link AggregatedParameterMetaData}.
[ "Returns", "the", "aggregated", "parameter", "meta", "data", "for", "the", "given", "method", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/jcache/embedded/src/main/java/org/infinispan/jcache/annotation/CacheKeyInvocationContextFactory.java#L149-L193
29,779
infinispan/infinispan
remote-query/remote-query-client/src/main/java/org/infinispan/query/remote/client/impl/MarshallerRegistration.java
MarshallerRegistration.registerProtoFiles
public static void registerProtoFiles(SerializationContext ctx) throws IOException { FileDescriptorSource fileDescriptorSource = new FileDescriptorSource(); fileDescriptorSource.addProtoFile(QUERY_PROTO_RES, MarshallerRegistration.class.getResourceAsStream(QUERY_PROTO_RES)); fileDescriptorSource.addProtoFile(MESSAGE_PROTO_RES, MarshallerRegistration.class.getResourceAsStream(MESSAGE_PROTO_RES)); ctx.registerProtoFiles(fileDescriptorSource); }
java
public static void registerProtoFiles(SerializationContext ctx) throws IOException { FileDescriptorSource fileDescriptorSource = new FileDescriptorSource(); fileDescriptorSource.addProtoFile(QUERY_PROTO_RES, MarshallerRegistration.class.getResourceAsStream(QUERY_PROTO_RES)); fileDescriptorSource.addProtoFile(MESSAGE_PROTO_RES, MarshallerRegistration.class.getResourceAsStream(MESSAGE_PROTO_RES)); ctx.registerProtoFiles(fileDescriptorSource); }
[ "public", "static", "void", "registerProtoFiles", "(", "SerializationContext", "ctx", ")", "throws", "IOException", "{", "FileDescriptorSource", "fileDescriptorSource", "=", "new", "FileDescriptorSource", "(", ")", ";", "fileDescriptorSource", ".", "addProtoFile", "(", ...
Registers proto files. @param ctx the serialization context @throws org.infinispan.protostream.DescriptorParserException if a proto definition file fails to parse correctly @throws IOException if proto file registration fails
[ "Registers", "proto", "files", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/remote-query/remote-query-client/src/main/java/org/infinispan/query/remote/client/impl/MarshallerRegistration.java#L41-L46
29,780
infinispan/infinispan
remote-query/remote-query-client/src/main/java/org/infinispan/query/remote/client/impl/MarshallerRegistration.java
MarshallerRegistration.registerMarshallers
public static void registerMarshallers(SerializationContext ctx) { ctx.registerMarshaller(new QueryRequest.NamedParameter.Marshaller()); ctx.registerMarshaller(new QueryRequest.Marshaller()); ctx.registerMarshaller(new QueryResponse.Marshaller()); ctx.registerMarshaller(new FilterResultMarshaller()); ctx.registerMarshaller(new ContinuousQueryResult.ResultType.Marshaller()); ctx.registerMarshaller(new ContinuousQueryResult.Marshaller()); }
java
public static void registerMarshallers(SerializationContext ctx) { ctx.registerMarshaller(new QueryRequest.NamedParameter.Marshaller()); ctx.registerMarshaller(new QueryRequest.Marshaller()); ctx.registerMarshaller(new QueryResponse.Marshaller()); ctx.registerMarshaller(new FilterResultMarshaller()); ctx.registerMarshaller(new ContinuousQueryResult.ResultType.Marshaller()); ctx.registerMarshaller(new ContinuousQueryResult.Marshaller()); }
[ "public", "static", "void", "registerMarshallers", "(", "SerializationContext", "ctx", ")", "{", "ctx", ".", "registerMarshaller", "(", "new", "QueryRequest", ".", "NamedParameter", ".", "Marshaller", "(", ")", ")", ";", "ctx", ".", "registerMarshaller", "(", "n...
Registers marshallers. @param ctx the serialization context
[ "Registers", "marshallers", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/remote-query/remote-query-client/src/main/java/org/infinispan/query/remote/client/impl/MarshallerRegistration.java#L53-L60
29,781
infinispan/infinispan
object-filter/src/main/java/org/infinispan/objectfilter/impl/aggregation/DoubleStat.java
DoubleStat.getSum
Double getSum() { if (count == 0) { return null; } // Better error bounds to add both terms as the final sum double tmp = sum + sumCompensation; if (Double.isNaN(tmp) && Double.isInfinite(simpleSum)) { // If the compensated sum is spuriously NaN from // accumulating one or more same-signed infinite values, // return the correctly-signed infinity stored in simpleSum. return simpleSum; } else { return tmp; } }
java
Double getSum() { if (count == 0) { return null; } // Better error bounds to add both terms as the final sum double tmp = sum + sumCompensation; if (Double.isNaN(tmp) && Double.isInfinite(simpleSum)) { // If the compensated sum is spuriously NaN from // accumulating one or more same-signed infinite values, // return the correctly-signed infinity stored in simpleSum. return simpleSum; } else { return tmp; } }
[ "Double", "getSum", "(", ")", "{", "if", "(", "count", "==", "0", ")", "{", "return", "null", ";", "}", "// Better error bounds to add both terms as the final sum", "double", "tmp", "=", "sum", "+", "sumCompensation", ";", "if", "(", "Double", ".", "isNaN", ...
Returns the sum of seen values. If any value is a NaN or the sum is at any point a NaN then the average will be NaN. The average returned can vary depending upon the order in which values are seen. @return the sum of values
[ "Returns", "the", "sum", "of", "seen", "values", ".", "If", "any", "value", "is", "a", "NaN", "or", "the", "sum", "is", "at", "any", "point", "a", "NaN", "then", "the", "average", "will", "be", "NaN", ".", "The", "average", "returned", "can", "vary",...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/object-filter/src/main/java/org/infinispan/objectfilter/impl/aggregation/DoubleStat.java#L40-L54
29,782
infinispan/infinispan
server/integration/commons/src/main/java/org/infinispan/server/commons/controller/Operations.java
Operations.createReadAttributeOperation
public static ModelNode createReadAttributeOperation(PathAddress address, String name) { return createAttributeOperation(ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION, address, name); }
java
public static ModelNode createReadAttributeOperation(PathAddress address, String name) { return createAttributeOperation(ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION, address, name); }
[ "public", "static", "ModelNode", "createReadAttributeOperation", "(", "PathAddress", "address", ",", "String", "name", ")", "{", "return", "createAttributeOperation", "(", "ModelDescriptionConstants", ".", "READ_ATTRIBUTE_OPERATION", ",", "address", ",", "name", ")", ";...
Creates a read-attribute operation using the specified address and name. @param address a resource path @param name an attribute name @return a read-attribute operation
[ "Creates", "a", "read", "-", "attribute", "operation", "using", "the", "specified", "address", "and", "name", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/commons/src/main/java/org/infinispan/server/commons/controller/Operations.java#L106-L108
29,783
infinispan/infinispan
server/integration/commons/src/main/java/org/infinispan/server/commons/controller/Operations.java
Operations.createWriteAttributeOperation
public static ModelNode createWriteAttributeOperation(PathAddress address, String name, ModelNode value) { ModelNode operation = createAttributeOperation(ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION, address, name); operation.get(ModelDescriptionConstants.VALUE).set(value); return operation; }
java
public static ModelNode createWriteAttributeOperation(PathAddress address, String name, ModelNode value) { ModelNode operation = createAttributeOperation(ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION, address, name); operation.get(ModelDescriptionConstants.VALUE).set(value); return operation; }
[ "public", "static", "ModelNode", "createWriteAttributeOperation", "(", "PathAddress", "address", ",", "String", "name", ",", "ModelNode", "value", ")", "{", "ModelNode", "operation", "=", "createAttributeOperation", "(", "ModelDescriptionConstants", ".", "WRITE_ATTRIBUTE_...
Creates a write-attribute operation using the specified address, namem and value. @param address a resource path @param name an attribute name @param value an attribute value @return a write-attribute operation
[ "Creates", "a", "write", "-", "attribute", "operation", "using", "the", "specified", "address", "namem", "and", "value", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/commons/src/main/java/org/infinispan/server/commons/controller/Operations.java#L117-L121
29,784
infinispan/infinispan
server/integration/commons/src/main/java/org/infinispan/server/commons/controller/Operations.java
Operations.createUndefineAttributeOperation
public static ModelNode createUndefineAttributeOperation(PathAddress address, String name) { return createAttributeOperation(ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION, address, name); }
java
public static ModelNode createUndefineAttributeOperation(PathAddress address, String name) { return createAttributeOperation(ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION, address, name); }
[ "public", "static", "ModelNode", "createUndefineAttributeOperation", "(", "PathAddress", "address", ",", "String", "name", ")", "{", "return", "createAttributeOperation", "(", "ModelDescriptionConstants", ".", "UNDEFINE_ATTRIBUTE_OPERATION", ",", "address", ",", "name", "...
Creates an undefine-attribute operation using the specified address and name. @param address a resource path @param name an attribute name @return an undefine-attribute operation
[ "Creates", "an", "undefine", "-", "attribute", "operation", "using", "the", "specified", "address", "and", "name", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/commons/src/main/java/org/infinispan/server/commons/controller/Operations.java#L129-L131
29,785
infinispan/infinispan
core/src/main/java/org/infinispan/configuration/cache/TransactionConfigurationBuilder.java
TransactionConfigurationBuilder.transactionManagerLookup
public TransactionConfigurationBuilder transactionManagerLookup(TransactionManagerLookup tml) { attributes.attribute(TRANSACTION_MANAGER_LOOKUP).set(tml); if (tml != null) { this.transactionMode(TransactionMode.TRANSACTIONAL); } return this; }
java
public TransactionConfigurationBuilder transactionManagerLookup(TransactionManagerLookup tml) { attributes.attribute(TRANSACTION_MANAGER_LOOKUP).set(tml); if (tml != null) { this.transactionMode(TransactionMode.TRANSACTIONAL); } return this; }
[ "public", "TransactionConfigurationBuilder", "transactionManagerLookup", "(", "TransactionManagerLookup", "tml", ")", "{", "attributes", ".", "attribute", "(", "TRANSACTION_MANAGER_LOOKUP", ")", ".", "set", "(", "tml", ")", ";", "if", "(", "tml", "!=", "null", ")", ...
Configure Transaction manager lookup directly using an instance of TransactionManagerLookup. Calling this method marks the cache as transactional.
[ "Configure", "Transaction", "manager", "lookup", "directly", "using", "an", "instance", "of", "TransactionManagerLookup", ".", "Calling", "this", "method", "marks", "the", "cache", "as", "transactional", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/cache/TransactionConfigurationBuilder.java#L168-L174
29,786
infinispan/infinispan
lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/FileListOperations.java
FileListOperations.addFileName
void addFileName(final String fileName) { writeLock.lock(); try { final FileListCacheValue fileList = getFileList(); boolean done = fileList.add(fileName); if (done) { updateFileList(fileList); if (trace) log.trace("Updated file listing: added " + fileName); } } finally { writeLock.unlock(); } }
java
void addFileName(final String fileName) { writeLock.lock(); try { final FileListCacheValue fileList = getFileList(); boolean done = fileList.add(fileName); if (done) { updateFileList(fileList); if (trace) log.trace("Updated file listing: added " + fileName); } } finally { writeLock.unlock(); } }
[ "void", "addFileName", "(", "final", "String", "fileName", ")", "{", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "final", "FileListCacheValue", "fileList", "=", "getFileList", "(", ")", ";", "boolean", "done", "=", "fileList", ".", "add", "(", "...
Adds a new fileName in the list of files making up this index @param fileName
[ "Adds", "a", "new", "fileName", "in", "the", "list", "of", "files", "making", "up", "this", "index" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/FileListOperations.java#L56-L69
29,787
infinispan/infinispan
lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/FileListOperations.java
FileListOperations.removeAndAdd
public void removeAndAdd(final String toRemove, final String toAdd) { writeLock.lock(); try { FileListCacheValue fileList = getFileList(); boolean done = fileList.addAndRemove(toAdd, toRemove); if (done) { updateFileList(fileList); if (trace) { log.trace("Updated file listing: added " + toAdd + " and removed " + toRemove); } } } finally { writeLock.unlock(); } }
java
public void removeAndAdd(final String toRemove, final String toAdd) { writeLock.lock(); try { FileListCacheValue fileList = getFileList(); boolean done = fileList.addAndRemove(toAdd, toRemove); if (done) { updateFileList(fileList); if (trace) { log.trace("Updated file listing: added " + toAdd + " and removed " + toRemove); } } } finally { writeLock.unlock(); } }
[ "public", "void", "removeAndAdd", "(", "final", "String", "toRemove", ",", "final", "String", "toAdd", ")", "{", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "FileListCacheValue", "fileList", "=", "getFileList", "(", ")", ";", "boolean", "done", "=...
Optimized implementation to perform both a remove and an add @param toRemove @param toAdd
[ "Optimized", "implementation", "to", "perform", "both", "a", "remove", "and", "an", "add" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/FileListOperations.java#L86-L100
29,788
infinispan/infinispan
lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/FileListOperations.java
FileListOperations.deleteFileName
public void deleteFileName(final String fileName) { writeLock.lock(); try { FileListCacheValue fileList = getFileList(); boolean done = fileList.remove(fileName); if (done) { updateFileList(fileList); if (trace) log.trace("Updated file listing: removed " + fileName); } } finally { writeLock.unlock(); } }
java
public void deleteFileName(final String fileName) { writeLock.lock(); try { FileListCacheValue fileList = getFileList(); boolean done = fileList.remove(fileName); if (done) { updateFileList(fileList); if (trace) log.trace("Updated file listing: removed " + fileName); } } finally { writeLock.unlock(); } }
[ "public", "void", "deleteFileName", "(", "final", "String", "fileName", ")", "{", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "FileListCacheValue", "fileList", "=", "getFileList", "(", ")", ";", "boolean", "done", "=", "fileList", ".", "remove", "...
Deleted a file from the list of files actively part of the index @param fileName
[ "Deleted", "a", "file", "from", "the", "list", "of", "files", "actively", "part", "of", "the", "index" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/FileListOperations.java#L131-L144
29,789
infinispan/infinispan
lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/FileListOperations.java
FileListOperations.updateFileList
@GuardedBy("writeLock") private void updateFileList(FileListCacheValue fileList) { if (writeAsync) { cacheNoRetrieve.putAsync(fileListCacheKey, fileList); } else { if (trace) { log.tracef("Updating file listing view from %s", getAddress(cacheNoRetrieve)); } cacheNoRetrieve.put(fileListCacheKey, fileList); } }
java
@GuardedBy("writeLock") private void updateFileList(FileListCacheValue fileList) { if (writeAsync) { cacheNoRetrieve.putAsync(fileListCacheKey, fileList); } else { if (trace) { log.tracef("Updating file listing view from %s", getAddress(cacheNoRetrieve)); } cacheNoRetrieve.put(fileListCacheKey, fileList); } }
[ "@", "GuardedBy", "(", "\"writeLock\"", ")", "private", "void", "updateFileList", "(", "FileListCacheValue", "fileList", ")", "{", "if", "(", "writeAsync", ")", "{", "cacheNoRetrieve", ".", "putAsync", "(", "fileListCacheKey", ",", "fileList", ")", ";", "}", "...
Makes sure the Cache is updated. @param fileList the new content
[ "Makes", "sure", "the", "Cache", "is", "updated", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/FileListOperations.java#L150-L161
29,790
infinispan/infinispan
query/src/main/java/org/infinispan/query/dsl/embedded/impl/IckleFilterAndConverter.java
IckleFilterAndConverter.injectDependencies
@Inject protected void injectDependencies(Cache cache) { this.queryCache = cache.getCacheManager().getGlobalComponentRegistry().getComponent(QueryCache.class); ComponentRegistry componentRegistry = cache.getAdvancedCache().getComponentRegistry(); matcher = componentRegistry.getComponent(matcherImplClass); if (matcher == null) { throw new CacheException("Expected component not found in registry: " + matcherImplClass.getName()); } }
java
@Inject protected void injectDependencies(Cache cache) { this.queryCache = cache.getCacheManager().getGlobalComponentRegistry().getComponent(QueryCache.class); ComponentRegistry componentRegistry = cache.getAdvancedCache().getComponentRegistry(); matcher = componentRegistry.getComponent(matcherImplClass); if (matcher == null) { throw new CacheException("Expected component not found in registry: " + matcherImplClass.getName()); } }
[ "@", "Inject", "protected", "void", "injectDependencies", "(", "Cache", "cache", ")", "{", "this", ".", "queryCache", "=", "cache", ".", "getCacheManager", "(", ")", ".", "getGlobalComponentRegistry", "(", ")", ".", "getComponent", "(", "QueryCache", ".", "cla...
Acquires a Matcher instance from the ComponentRegistry of the given Cache object.
[ "Acquires", "a", "Matcher", "instance", "from", "the", "ComponentRegistry", "of", "the", "given", "Cache", "object", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/dsl/embedded/impl/IckleFilterAndConverter.java#L73-L81
29,791
infinispan/infinispan
core/src/main/java/org/infinispan/factories/InternalCacheFactory.java
InternalCacheFactory.createCache
public Cache<K, V> createCache(Configuration configuration, GlobalComponentRegistry globalComponentRegistry, String cacheName) throws CacheConfigurationException { try { if (configuration.compatibility().enabled()) { log.warnCompatibilityDeprecated(cacheName); } if (configuration.simpleCache()) { return createSimpleCache(configuration, globalComponentRegistry, cacheName); } else { return createAndWire(configuration, globalComponentRegistry, cacheName); } } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } }
java
public Cache<K, V> createCache(Configuration configuration, GlobalComponentRegistry globalComponentRegistry, String cacheName) throws CacheConfigurationException { try { if (configuration.compatibility().enabled()) { log.warnCompatibilityDeprecated(cacheName); } if (configuration.simpleCache()) { return createSimpleCache(configuration, globalComponentRegistry, cacheName); } else { return createAndWire(configuration, globalComponentRegistry, cacheName); } } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } }
[ "public", "Cache", "<", "K", ",", "V", ">", "createCache", "(", "Configuration", "configuration", ",", "GlobalComponentRegistry", "globalComponentRegistry", ",", "String", "cacheName", ")", "throws", "CacheConfigurationException", "{", "try", "{", "if", "(", "config...
This implementation clones the configuration passed in before using it. @param configuration to use @param globalComponentRegistry global component registry to attach the cache to @param cacheName name of the cache @return a cache @throws CacheConfigurationException if there are problems with the cfg
[ "This", "implementation", "clones", "the", "configuration", "passed", "in", "before", "using", "it", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/factories/InternalCacheFactory.java#L83-L99
29,792
infinispan/infinispan
core/src/main/java/org/infinispan/factories/InternalCacheFactory.java
InternalCacheFactory.bootstrap
private void bootstrap(String cacheName, AdvancedCache<?, ?> cache, Configuration configuration, GlobalComponentRegistry globalComponentRegistry, StreamingMarshaller globalMarshaller) { this.configuration = configuration; // injection bootstrap stuff componentRegistry = new ComponentRegistry(cacheName, configuration, cache, globalComponentRegistry, globalComponentRegistry.getClassLoader()); EncoderRegistry encoderRegistry = globalComponentRegistry.getComponent(EncoderRegistry.class); // Wraps the compatibility marshaller so that it can be used as a transcoder if (configuration.compatibility().enabled() && configuration.compatibility().marshaller() != null) { Marshaller marshaller = configuration.compatibility().marshaller(); componentRegistry.wireDependencies(marshaller); if (!encoderRegistry.isConversionSupported(MediaType.APPLICATION_OBJECT, marshaller.mediaType())) { encoderRegistry.registerTranscoder(new TranscoderMarshallerAdapter(marshaller)); } } // Wraps the GlobalMarshaller so that it can be used as a transcoder encoderRegistry.registerTranscoder(new TranscoderMarshallerAdapter(globalMarshaller)); /* -------------------------------------------------------------------------------------------------------------- This is where the bootstrap really happens. Registering the cache in the component registry will cause the component registry to look at the cache's @Inject methods, and construct various components and their dependencies, in turn. -------------------------------------------------------------------------------------------------------------- */ basicComponentRegistry = componentRegistry.getComponent(BasicComponentRegistry.class); basicComponentRegistry.registerAlias(Cache.class.getName(), AdvancedCache.class.getName(), AdvancedCache.class); basicComponentRegistry.registerComponent(AdvancedCache.class.getName(), cache, false); componentRegistry.registerComponent(new CacheJmxRegistration(), CacheJmxRegistration.class.getName(), true); if (configuration.transaction().recovery().enabled()) { componentRegistry.registerComponent(new RecoveryAdminOperations(), RecoveryAdminOperations.class.getName(), true); } if (configuration.sites().hasEnabledBackups()) { componentRegistry.registerComponent(new XSiteAdminOperations(), XSiteAdminOperations.class.getName(), true); } // The RollingUpgradeManager should always be added so it is registered in JMX. componentRegistry.registerComponent(new RollingUpgradeManager(), RollingUpgradeManager.class.getName(), true); }
java
private void bootstrap(String cacheName, AdvancedCache<?, ?> cache, Configuration configuration, GlobalComponentRegistry globalComponentRegistry, StreamingMarshaller globalMarshaller) { this.configuration = configuration; // injection bootstrap stuff componentRegistry = new ComponentRegistry(cacheName, configuration, cache, globalComponentRegistry, globalComponentRegistry.getClassLoader()); EncoderRegistry encoderRegistry = globalComponentRegistry.getComponent(EncoderRegistry.class); // Wraps the compatibility marshaller so that it can be used as a transcoder if (configuration.compatibility().enabled() && configuration.compatibility().marshaller() != null) { Marshaller marshaller = configuration.compatibility().marshaller(); componentRegistry.wireDependencies(marshaller); if (!encoderRegistry.isConversionSupported(MediaType.APPLICATION_OBJECT, marshaller.mediaType())) { encoderRegistry.registerTranscoder(new TranscoderMarshallerAdapter(marshaller)); } } // Wraps the GlobalMarshaller so that it can be used as a transcoder encoderRegistry.registerTranscoder(new TranscoderMarshallerAdapter(globalMarshaller)); /* -------------------------------------------------------------------------------------------------------------- This is where the bootstrap really happens. Registering the cache in the component registry will cause the component registry to look at the cache's @Inject methods, and construct various components and their dependencies, in turn. -------------------------------------------------------------------------------------------------------------- */ basicComponentRegistry = componentRegistry.getComponent(BasicComponentRegistry.class); basicComponentRegistry.registerAlias(Cache.class.getName(), AdvancedCache.class.getName(), AdvancedCache.class); basicComponentRegistry.registerComponent(AdvancedCache.class.getName(), cache, false); componentRegistry.registerComponent(new CacheJmxRegistration(), CacheJmxRegistration.class.getName(), true); if (configuration.transaction().recovery().enabled()) { componentRegistry.registerComponent(new RecoveryAdminOperations(), RecoveryAdminOperations.class.getName(), true); } if (configuration.sites().hasEnabledBackups()) { componentRegistry.registerComponent(new XSiteAdminOperations(), XSiteAdminOperations.class.getName(), true); } // The RollingUpgradeManager should always be added so it is registered in JMX. componentRegistry.registerComponent(new RollingUpgradeManager(), RollingUpgradeManager.class.getName(), true); }
[ "private", "void", "bootstrap", "(", "String", "cacheName", ",", "AdvancedCache", "<", "?", ",", "?", ">", "cache", ",", "Configuration", "configuration", ",", "GlobalComponentRegistry", "globalComponentRegistry", ",", "StreamingMarshaller", "globalMarshaller", ")", "...
Bootstraps this factory with a Configuration and a ComponentRegistry.
[ "Bootstraps", "this", "factory", "with", "a", "Configuration", "and", "a", "ComponentRegistry", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/factories/InternalCacheFactory.java#L189-L230
29,793
infinispan/infinispan
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/RemoteCacheImpl.java
RemoteCacheImpl.init
public void init(Marshaller marshaller, OperationsFactory operationsFactory, int estimateKeySize, int estimateValueSize, int batchSize) { this.defaultMarshaller = marshaller; this.operationsFactory = operationsFactory; this.estimateKeySize = estimateKeySize; this.estimateValueSize = estimateValueSize; this.batchSize = batchSize; this.dataFormat = defaultDataFormat; }
java
public void init(Marshaller marshaller, OperationsFactory operationsFactory, int estimateKeySize, int estimateValueSize, int batchSize) { this.defaultMarshaller = marshaller; this.operationsFactory = operationsFactory; this.estimateKeySize = estimateKeySize; this.estimateValueSize = estimateValueSize; this.batchSize = batchSize; this.dataFormat = defaultDataFormat; }
[ "public", "void", "init", "(", "Marshaller", "marshaller", ",", "OperationsFactory", "operationsFactory", ",", "int", "estimateKeySize", ",", "int", "estimateValueSize", ",", "int", "batchSize", ")", "{", "this", ".", "defaultMarshaller", "=", "marshaller", ";", "...
Inititalize without mbeans
[ "Inititalize", "without", "mbeans" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/RemoteCacheImpl.java#L132-L140
29,794
infinispan/infinispan
demos/gui/src/main/java/org/infinispan/demo/InfinispanDemo.java
AlternateColorTable.prepareRenderer
@Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component c = super.prepareRenderer(renderer, row, column); if (!isCellSelected(row, column)) { c.setBackground(colorForRow(row)); c.setForeground(UIManager.getColor("Table.foreground")); } else { c.setBackground(UIManager.getColor("Table.selectionBackground")); c.setForeground(UIManager.getColor("Table.selectionForeground")); } return c; }
java
@Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component c = super.prepareRenderer(renderer, row, column); if (!isCellSelected(row, column)) { c.setBackground(colorForRow(row)); c.setForeground(UIManager.getColor("Table.foreground")); } else { c.setBackground(UIManager.getColor("Table.selectionBackground")); c.setForeground(UIManager.getColor("Table.selectionForeground")); } return c; }
[ "@", "Override", "public", "Component", "prepareRenderer", "(", "TableCellRenderer", "renderer", ",", "int", "row", ",", "int", "column", ")", "{", "Component", "c", "=", "super", ".", "prepareRenderer", "(", "renderer", ",", "row", ",", "column", ")", ";", ...
Shades alternate rows in different colors.
[ "Shades", "alternate", "rows", "in", "different", "colors", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/demos/gui/src/main/java/org/infinispan/demo/InfinispanDemo.java#L504-L515
29,795
infinispan/infinispan
extended-statistics/src/main/java/org/infinispan/stats/CacheStatisticCollector.java
CacheStatisticCollector.reset
public final void reset() { if (trace) { log.tracef("Resetting Node Scope Statistics"); } globalContainer.reset(); percentiles = new EnumMap<>(PercentileStatistic.class); for (PercentileStatistic percentileStatistic : PercentileStatistic.values()) { percentiles.put(percentileStatistic, new ReservoirSampler()); } }
java
public final void reset() { if (trace) { log.tracef("Resetting Node Scope Statistics"); } globalContainer.reset(); percentiles = new EnumMap<>(PercentileStatistic.class); for (PercentileStatistic percentileStatistic : PercentileStatistic.values()) { percentiles.put(percentileStatistic, new ReservoirSampler()); } }
[ "public", "final", "void", "reset", "(", ")", "{", "if", "(", "trace", ")", "{", "log", ".", "tracef", "(", "\"Resetting Node Scope Statistics\"", ")", ";", "}", "globalContainer", ".", "reset", "(", ")", ";", "percentiles", "=", "new", "EnumMap", "<>", ...
reset all the statistics collected so far.
[ "reset", "all", "the", "statistics", "collected", "so", "far", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/extended-statistics/src/main/java/org/infinispan/stats/CacheStatisticCollector.java#L100-L109
29,796
infinispan/infinispan
extended-statistics/src/main/java/org/infinispan/stats/CacheStatisticCollector.java
CacheStatisticCollector.merge
public final void merge(TransactionStatistics transactionStatistics) { if (trace) { log.tracef("Merge transaction statistics %s to the node statistics", transactionStatistics); } ReservoirSampler reservoirSampler; ExtendedStatistic percentileSample; if (transactionStatistics.isLocalTransaction()) { if (transactionStatistics.isReadOnly()) { reservoirSampler = percentiles.get(RO_LOCAL_EXECUTION); percentileSample = transactionStatistics.isCommitted() ? RO_TX_SUCCESSFUL_EXECUTION_TIME : RO_TX_ABORTED_EXECUTION_TIME; } else { reservoirSampler = percentiles.get(WR_LOCAL_EXECUTION); percentileSample = transactionStatistics.isCommitted() ? WR_TX_SUCCESSFUL_EXECUTION_TIME : WR_TX_ABORTED_EXECUTION_TIME; } } else { if (transactionStatistics.isReadOnly()) { reservoirSampler = percentiles.get(RO_REMOTE_EXECUTION); percentileSample = transactionStatistics.isCommitted() ? RO_TX_SUCCESSFUL_EXECUTION_TIME : RO_TX_ABORTED_EXECUTION_TIME; } else { reservoirSampler = percentiles.get(WR_REMOTE_EXECUTION); percentileSample = transactionStatistics.isCommitted() ? WR_TX_SUCCESSFUL_EXECUTION_TIME : WR_TX_ABORTED_EXECUTION_TIME; } } doMerge(transactionStatistics, reservoirSampler, percentileSample); }
java
public final void merge(TransactionStatistics transactionStatistics) { if (trace) { log.tracef("Merge transaction statistics %s to the node statistics", transactionStatistics); } ReservoirSampler reservoirSampler; ExtendedStatistic percentileSample; if (transactionStatistics.isLocalTransaction()) { if (transactionStatistics.isReadOnly()) { reservoirSampler = percentiles.get(RO_LOCAL_EXECUTION); percentileSample = transactionStatistics.isCommitted() ? RO_TX_SUCCESSFUL_EXECUTION_TIME : RO_TX_ABORTED_EXECUTION_TIME; } else { reservoirSampler = percentiles.get(WR_LOCAL_EXECUTION); percentileSample = transactionStatistics.isCommitted() ? WR_TX_SUCCESSFUL_EXECUTION_TIME : WR_TX_ABORTED_EXECUTION_TIME; } } else { if (transactionStatistics.isReadOnly()) { reservoirSampler = percentiles.get(RO_REMOTE_EXECUTION); percentileSample = transactionStatistics.isCommitted() ? RO_TX_SUCCESSFUL_EXECUTION_TIME : RO_TX_ABORTED_EXECUTION_TIME; } else { reservoirSampler = percentiles.get(WR_REMOTE_EXECUTION); percentileSample = transactionStatistics.isCommitted() ? WR_TX_SUCCESSFUL_EXECUTION_TIME : WR_TX_ABORTED_EXECUTION_TIME; } } doMerge(transactionStatistics, reservoirSampler, percentileSample); }
[ "public", "final", "void", "merge", "(", "TransactionStatistics", "transactionStatistics", ")", "{", "if", "(", "trace", ")", "{", "log", ".", "tracef", "(", "\"Merge transaction statistics %s to the node statistics\"", ",", "transactionStatistics", ")", ";", "}", "Re...
Merges a transaction statistics in this cache statistics.
[ "Merges", "a", "transaction", "statistics", "in", "this", "cache", "statistics", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/extended-statistics/src/main/java/org/infinispan/stats/CacheStatisticCollector.java#L114-L142
29,797
infinispan/infinispan
remote-query/remote-query-server/src/main/java/org/infinispan/query/remote/impl/LifecycleManager.java
LifecycleManager.cacheStarting
@Override public void cacheStarting(ComponentRegistry cr, Configuration cfg, String cacheName) { BasicComponentRegistry gcr = cr.getGlobalComponentRegistry().getComponent(BasicComponentRegistry.class); InternalCacheRegistry icr = gcr.getComponent(InternalCacheRegistry.class).running(); if (!icr.isInternalCache(cacheName)) { ProtobufMetadataManagerImpl protobufMetadataManager = (ProtobufMetadataManagerImpl) gcr.getComponent(ProtobufMetadataManager.class).running(); protobufMetadataManager.addCacheDependency(cacheName); SerializationContext serCtx = protobufMetadataManager.getSerializationContext(); RemoteQueryManager remoteQueryManager = buildQueryManager(cfg, serCtx, cr); cr.registerComponent(remoteQueryManager, RemoteQueryManager.class); } }
java
@Override public void cacheStarting(ComponentRegistry cr, Configuration cfg, String cacheName) { BasicComponentRegistry gcr = cr.getGlobalComponentRegistry().getComponent(BasicComponentRegistry.class); InternalCacheRegistry icr = gcr.getComponent(InternalCacheRegistry.class).running(); if (!icr.isInternalCache(cacheName)) { ProtobufMetadataManagerImpl protobufMetadataManager = (ProtobufMetadataManagerImpl) gcr.getComponent(ProtobufMetadataManager.class).running(); protobufMetadataManager.addCacheDependency(cacheName); SerializationContext serCtx = protobufMetadataManager.getSerializationContext(); RemoteQueryManager remoteQueryManager = buildQueryManager(cfg, serCtx, cr); cr.registerComponent(remoteQueryManager, RemoteQueryManager.class); } }
[ "@", "Override", "public", "void", "cacheStarting", "(", "ComponentRegistry", "cr", ",", "Configuration", "cfg", ",", "String", "cacheName", ")", "{", "BasicComponentRegistry", "gcr", "=", "cr", ".", "getGlobalComponentRegistry", "(", ")", ".", "getComponent", "("...
Registers the remote value wrapper interceptor in the cache before it gets started.
[ "Registers", "the", "remote", "value", "wrapper", "interceptor", "in", "the", "cache", "before", "it", "gets", "started", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/remote-query/remote-query-server/src/main/java/org/infinispan/query/remote/impl/LifecycleManager.java#L167-L181
29,798
infinispan/infinispan
hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/TxPutFromLoadInterceptor.java
TxPutFromLoadInterceptor.visitPrepareCommand
@Override public Object visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) throws Throwable { if (ctx.isOriginLocal()) { // We can't wait to commit phase to remove the entry locally (invalidations are processed in 1pc // on remote nodes, so only local case matters here). The problem is that while the entry is locked // reads still can take place and we can read outdated collection after reading updated entity // owning this collection from DB; when this happens, the version lock on entity cannot protect // us against concurrent modification of the collection. Therefore, we need to remove the entry // here (even without lock!) and let possible update happen in commit phase. for (WriteCommand wc : command.getModifications()) { for (Object key : wc.getAffectedKeys()) { dataContainer.remove(key); } } } else { for (WriteCommand wc : command.getModifications()) { Collection<?> keys = wc.getAffectedKeys(); if (log.isTraceEnabled()) { log.tracef("Invalidating keys %s with lock owner %s", keys, ctx.getLockOwner()); } for (Object key : keys ) { putFromLoadValidator.beginInvalidatingKey(ctx.getLockOwner(), key); } } } return invokeNext(ctx, command); }
java
@Override public Object visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) throws Throwable { if (ctx.isOriginLocal()) { // We can't wait to commit phase to remove the entry locally (invalidations are processed in 1pc // on remote nodes, so only local case matters here). The problem is that while the entry is locked // reads still can take place and we can read outdated collection after reading updated entity // owning this collection from DB; when this happens, the version lock on entity cannot protect // us against concurrent modification of the collection. Therefore, we need to remove the entry // here (even without lock!) and let possible update happen in commit phase. for (WriteCommand wc : command.getModifications()) { for (Object key : wc.getAffectedKeys()) { dataContainer.remove(key); } } } else { for (WriteCommand wc : command.getModifications()) { Collection<?> keys = wc.getAffectedKeys(); if (log.isTraceEnabled()) { log.tracef("Invalidating keys %s with lock owner %s", keys, ctx.getLockOwner()); } for (Object key : keys ) { putFromLoadValidator.beginInvalidatingKey(ctx.getLockOwner(), key); } } } return invokeNext(ctx, command); }
[ "@", "Override", "public", "Object", "visitPrepareCommand", "(", "TxInvocationContext", "ctx", ",", "PrepareCommand", "command", ")", "throws", "Throwable", "{", "if", "(", "ctx", ".", "isOriginLocal", "(", ")", ")", "{", "// We can't wait to commit phase to remove th...
as part of EntryWrappingInterceptor
[ "as", "part", "of", "EntryWrappingInterceptor" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/TxPutFromLoadInterceptor.java#L100-L127
29,799
infinispan/infinispan
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HeaderDecoder.java
HeaderDecoder.removeListener
public void removeListener(byte[] listenerId) { boolean removed = listeners.removeIf(id -> Arrays.equals(id, listenerId)); if (trace) { log.tracef("Decoder %08X removed? %s listener %s", hashCode(), Boolean.toString(removed), Util.printArray(listenerId)); } }
java
public void removeListener(byte[] listenerId) { boolean removed = listeners.removeIf(id -> Arrays.equals(id, listenerId)); if (trace) { log.tracef("Decoder %08X removed? %s listener %s", hashCode(), Boolean.toString(removed), Util.printArray(listenerId)); } }
[ "public", "void", "removeListener", "(", "byte", "[", "]", "listenerId", ")", "{", "boolean", "removed", "=", "listeners", ".", "removeIf", "(", "id", "->", "Arrays", ".", "equals", "(", "id", ",", "listenerId", ")", ")", ";", "if", "(", "trace", ")", ...
must be called from event loop thread!
[ "must", "be", "called", "from", "event", "loop", "thread!" ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HeaderDecoder.java#L277-L282