@Override public Void call() throws Exception { ignite.queue(name, 0, null); return null; } }, IgniteException.class, null);
/** {@inheritDoc} */ @Nullable @Override public <T> IgniteQueue<T> queue(String name, int cap, CollectionConfiguration cfg) { checkIgnite(); return g.queue(name, cap, cfg); }
@Override public Void call() throws Exception { ignite.queue(name, 0, null); return null; } }, IgniteException.class, null);
/** {@inheritDoc} */ @Override public void init(ServiceContext ctx) { Ignite ignite = Ignition.localIgnite(); reqQueue = ignite.queue(String.format(INFERENCE_REQUEST_QUEUE_NAME_PATTERN, suffix), QUEUE_CAPACITY, queueCfg); resQueue = ignite.queue(String.format(INFERENCE_RESPONSE_QUEUE_NAME_PATTERN, suffix), QUEUE_CAPACITY, queueCfg); mdl = parser.parse(reader.read()); }
@Override public Object call() throws Exception { boolean failed = false; try { client.queue("TestQueue", 10, getCollectionConfiguration()); } catch (IgniteClientDisconnectedException e) { failed = true; checkAndWait(e); } assertTrue(failed); return client.queue("TestQueue", 10, getCollectionConfiguration()); } },
@Override public Void call() throws Exception { ignite.queue(name, 0, config(false)); return null; } }, IgniteException.class, null);
@Override public Void call() throws Exception { ignite.queue(name, 0, config(false)); return null; } }, IgniteException.class, null);
@Override public Object apply(Ignite ignite) { IgniteQueue<Integer> queue = ignite.queue(STRUCTURE_NAME, 0, null); assertNotNull(queue); Integer val = queue.peek(); assertNotNull(val); assert val > 0; return null; } });
@Override public void applyx(Ignite ignite) { IgniteQueue<Integer> q = ignite.queue(TEST_QUEUE_NAME, 0, colCfg); for (int i = 0; i < operationsPerTx; i++) { q.put(RAND.nextInt(MAX_INT)); long cnt = writes.incrementAndGet(); if (cnt % WRITE_LOG_MOD == 0) info("Performed " + cnt + " writes."); } } };
@Override public void applyx(Ignite ignite) { IgniteQueue<Integer> q = ignite.queue(TEST_QUEUE_NAME, 0, colCfg); for (int i = 0; i < operationsPerTx; i++) { q.peek(); long cnt = reads.incrementAndGet(); if (cnt % READ_LOG_MOD == 0) info("Performed " + cnt + " reads."); } } };
/** {@inheritDoc} */ @Override public Integer call() throws IgniteCheckedException { assertNotNull(ignite); ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + "]"); IgniteQueue<Integer> queue = ignite.queue(queueName, 0, null); assertNotNull(queue); Collection<Integer> items = new ArrayList<>(); for (int i = 0; i < size; i++) items.add(cntr.getAndIncrement()); queue.addAll(items); return queue.size(); }
/** {@inheritDoc} */ @Override public Integer call() throws IgniteCheckedException { assertNotNull(ignite); ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + "]"); IgniteQueue<Integer> queue = ignite.queue(queueName, 0, null); assertNotNull(queue); for (int i = 0; i < retries; i++) queue.put(cntr.getAndIncrement()); return queue.size(); }
/** {@inheritDoc} */ @Override public Integer call() throws IgniteCheckedException { assertNotNull(ignite); ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + "]"); IgniteQueue<String> queue = ignite.queue(queueName, QUEUE_CAPACITY, colCfg); assertNotNull(queue); assertEquals(1, queue.size()); for (int i = 0; i < retries; i++) { assertEquals(expVal, queue.peek()); assertEquals(expVal, queue.element()); } return queue.size(); }
/** {@inheritDoc} */ @Override public Integer call() throws IgniteCheckedException { assertNotNull(ignite); ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + ']'); IgniteQueue<Integer> queue = ignite.queue(queueName, 0, null); assertNotNull(queue); for (int i = 0; i < retries; i++) { queue.put(i); assertNotNull(queue.take()); } return queue.size(); }
/** {@inheritDoc} */ @Override public Integer call() throws IgniteCheckedException { assertNotNull(ignite); ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + "]"); IgniteQueue<Integer> queue = ignite.queue(queueName, QUEUE_CAPACITY, colCfg); assertNotNull(queue); for (int i = 0; i < retries; i++) queue.put(i); return queue.size(); }
/** * @param colCfg Collection configuration. * @throws Exception If failed. */ private void serverNodeReconnect(CollectionConfiguration colCfg) throws Exception { final Ignite client = grid(serverCount()); final Ignite srv = ignite(0); assertNotNull(srv.queue("q", 0, colCfg)); assertNotNull(srv.set("s", colCfg)); reconnectClientNode(client, srv, null); IgniteQueue<Object> q = client.queue("q", 0, null); assertNotNull(q); }
/** {@inheritDoc} */ @Override public Boolean call() throws IgniteCheckedException { assertNotNull(ignite); ignite.log().info("Running job [node=" + ignite.cluster().localNode().id() + ", job=" + this + "]"); IgniteQueue<Integer> queue = ignite.queue(queueName, 0, null); assert queue != null; assert queue.capacity() == QUEUE_CAPACITY; queue.close(); return true; }
/** {@inheritDoc} */ @Override public Collection<Integer> call() throws Exception { Collection<Integer> values = new ArrayList<>(); grid.log().info("Running job [node=" + grid.cluster().localNode().id() + ", job=" + this + "]"); IgniteQueue<Integer> locQueue = grid.queue(queueName, QUEUE_CAPACITY, config(false)); grid.log().info("Queue size " + locQueue.size()); for (Integer element : locQueue) values.add(element); return values; } }
@Override public void apply(Ignite ignite) { for (int i = 0; i < 100; i++) { CollectionConfiguration colCfg = new CollectionConfiguration(); colCfg.setBackups(1); colCfg.setCacheMode(PARTITIONED); colCfg.setAtomicityMode(i % 2 == 0 ? TRANSACTIONAL : ATOMIC); IgniteQueue q = ignite.queue("q-" + i, 0, colCfg); q.close(); } } });
/** {@inheritDoc} */ @Override public Collection<Integer> call() throws Exception { Collection<Integer> values = new ArrayList<>(); grid.log().info("Running job [node=" + grid.cluster().localNode().id() + "]"); IgniteQueue<Integer> locQueue = grid.queue(queueName, 0, null); grid.log().info("Queue size " + locQueue.size()); for (Integer element : locQueue) values.add(element); grid.log().info("Returning: " + values); return values; } }