/** {@inheritDoc} */ @Override public void removeNode(UUID nodeId) { delegate.removeNode(nodeId); } }
/** {@inheritDoc} */ @Override public void reset() { // userFunc is always in initial state (it is serialized only once on start). if (baseFunc != null) baseFunc.reset(); }
/** * @param useColocatedData Use colocated data. * @return Key. */ public Object key(boolean useColocatedData) { return useColocatedData ? new AffinityKey<>(id, refOrderId) : id; }
@Override public Object call() throws Exception { return affinity.mapKeyToNode(key); } }, IgniteException.class, EXPECTED_MSG);
/** * @param aff Affinity. * @param key Key. * @return Nodes. */ private static Collection<? extends ClusterNode> nodes(Affinity<Object> aff, Object key) { return aff.mapKeyToPrimaryAndBackups(key); }
@Override public boolean apply() { return aff.primaryPartitions(node).length > 0; } }, 5000));
/** * @param c Cache projection. */ private void affinityAfterStart(IgniteCache<Integer, String> c) { if (DEBUG) { for (int key = 0; key < keyCnt; key++) { int part = affinity(c).partition(key); info("Affinity nodes after start [key=" + key + ", partition" + part + ", nodes=" + U.nodeIds(affinity(c).mapPartitionToPrimaryAndBackups(part)) + ']'); } } }
@Override public Object call() throws Exception { return affinity.allPartitions(n); } }, IgniteException.class, EXPECTED_MSG);
/** * @throws Exception If failed. */ protected void checkNodeRemoved(int backups) throws Exception { checkNodeRemoved(backups, 1, 1); }
/** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { super.afterTestsStopped(); ignite = null; }
/** * @return Custom affinity key to guarantee that person is always collocated with organization. */ public AffinityKey<Integer> key() { return new AffinityKey<>(id, orgId); }
/** * @param aff Affinity. * @param key Key. * @return Nodes. */ private static Collection<? extends ClusterNode> nodes(Affinity<Object> aff, Object key) { return aff.mapKeyToPrimaryAndBackups(key); }
/** {@inheritDoc} */ @Override public void removeNode(UUID nodeId) { delegate.removeNode(nodeId); } }
/** * @param c Cache projection. */ private void affinityBeforeStop(IgniteCache<Integer, String> c) { if (DEBUG) { for (int key = 0; key < keyCnt; key++) { int part = affinity(c).partition(key); info("Affinity nodes before stop [key=" + key + ", partition" + part + ", nodes=" + U.nodeIds(affinity(c).mapPartitionToPrimaryAndBackups(part)) + ']'); } } }
/** * @param useCollocatedData Use collocated data. * @return Key. */ public Object key(boolean useCollocatedData) { return useCollocatedData ? new AffinityKey<>(id, orgId) : id; }
/** * @param aff Affinity. * @param key Key. * @return Nodes. */ private static Collection<? extends ClusterNode> nodes(Affinity<Object> aff, Object key) { return aff.mapKeyToPrimaryAndBackups(key); }
/** * @param useCollocatedData Use colocated data. * @return Key. */ public Object key(boolean useCollocatedData) { return useCollocatedData ? new AffinityKey<>(id, orgId) : id; }
/** * @return Custom affinity key to guarantee that purchase is always collocated with person. */ public AffinityKey<Integer> key() { return new AffinityKey<>(id, organizationId); }
/** * @param useColocatedData Use colocated data. * @return Key. */ public Object key(boolean useColocatedData) { return useColocatedData ? new AffinityKey<>(id, orderId) : id; }
/** * @param useColocatedData Use colocated data.* * @return Key. */ public Object key(boolean useColocatedData) { return useColocatedData ? new AffinityKey<>(id, orderId) : id; }