/** {@inheritDoc} */ @Override public IgniteInternalFuture<?> putAllAsync0(Map<? extends K, ? extends V> m) { return updateAllAsync0(m, null, null, false, false, null).chain(RET2NULL); }
/** * @param fut Internal future. * @return User future. */ private IgniteFuture<?> createFuture(IgniteInternalFuture<IgniteInternalTx> fut) { IgniteInternalFuture<Transaction> fut0 = fut.chain(new CX1<IgniteInternalFuture<IgniteInternalTx>, Transaction>() { @Override public Transaction applyx(IgniteInternalFuture<IgniteInternalTx> fut) throws IgniteCheckedException { fut.get(); return TransactionProxyImpl.this; } }); return new IgniteFutureImpl(fut0); }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<?> putAllAsync0(Map<? extends K, ? extends V> m) { return updateAll0(m, null, null, null, null, false, false, UPDATE, true).chain(RET2NULL); }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<?> applyx(IgniteInternalCache<Object, Object> c, GridKernalContext ctx) { return c.putAllAsync(map).chain(new FixedResult(true)); } }
/** {@inheritDoc} */ @Override public IgfsModeResolver modeResolver() throws IgniteCheckedException { return io.send(new IgfsModeResolverRequest()).chain(MODE_RESOLVER_RES).get(); } }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<?> applyx(IgniteInternalCache<Object, Object> c, GridKernalContext ctx) { return (F.isEmpty(keys) ? c.removeAllAsync() : c.removeAllAsync(keys)) .chain(new FixedResult(true)); } }
/** {@inheritDoc} */ @Override public GridRestResponse call() throws Exception { final IgniteInternalCache<Object, Object> cache = cache(g, cacheName).forSubjectId(clientId); // Need to apply both operation and response transformation remotely // as cache could be inaccessible on local node and // exception processing should be consistent with local execution. return op.apply(cache, ((IgniteKernal)g).context()).chain(resultWrapper(cache, key)).get(); } }
/** {@inheritDoc} */ @Override public IgfsHandshakeResponse handshake(String logDir) throws IgniteCheckedException { final IgfsHandshakeRequest req = new IgfsHandshakeRequest(); req.igfsName(igfs); req.logDirectory(logDir); return io.send(req).chain(HANDSHAKE_RES).get(); }
/** {@inheritDoc} */ @Override public IgfsFile info(IgfsPath path) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(INFO); msg.path(path); msg.userName(userName); return io.send(msg).chain(FILE_RES).get(); }
/** {@inheritDoc} */ @Override public Collection<IgfsFile> listFiles(IgfsPath path) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(LIST_FILES); msg.path(path); msg.userName(userName); return io.send(msg).chain(FILE_COL_RES).get(); }
/** {@inheritDoc} */ @Override public Collection<IgfsPath> listPaths(IgfsPath path) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(LIST_PATHS); msg.path(path); msg.userName(userName); return io.send(msg).chain(PATH_COL_RES).get(); }
/** {@inheritDoc} */ @Override public HadoopIgfsStreamDelegate append(IgfsPath path, boolean create, @Nullable Map<String, String> props) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(OPEN_APPEND); msg.path(path); msg.flag(create); msg.properties(props); msg.userName(userName); Long streamId = io.send(msg).chain(LONG_RES).get(); return new HadoopIgfsStreamDelegate(this, streamId); }
/** {@inheritDoc} */ @Override public Boolean rename(IgfsPath src, IgfsPath dest) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(RENAME); msg.path(src); msg.destinationPath(dest); msg.userName(userName); return io.send(msg).chain(BOOL_RES).get(); }
/** {@inheritDoc} */ @Override public Boolean mkdirs(IgfsPath path, Map<String, String> props) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(MAKE_DIRECTORIES); msg.path(path); msg.properties(props); msg.userName(userName); return io.send(msg).chain(BOOL_RES).get(); }
/** {@inheritDoc} */ @Override public void closeStream(HadoopIgfsStreamDelegate desc) throws IOException { final IgfsStreamControlRequest msg = new IgfsStreamControlRequest(); msg.command(CLOSE); msg.streamId((long)desc.target()); try { io.send(msg).chain(BOOL_RES).get(); } catch (IgniteCheckedException e) { throw HadoopIgfsUtils.cast(e); } }
/** {@inheritDoc} */ @Override public Boolean delete(IgfsPath path, boolean recursive) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(DELETE); msg.path(path); msg.flag(recursive); msg.userName(userName); return io.send(msg).chain(BOOL_RES).get(); }
/** {@inheritDoc} */ @Override public Boolean setTimes(IgfsPath path, long accessTime, long modificationTime) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(SET_TIMES); msg.path(path); msg.accessTime(accessTime); msg.modificationTime(modificationTime); msg.userName(userName); return io.send(msg).chain(BOOL_RES).get(); }
/** {@inheritDoc} */ @Override public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(AFFINITY); msg.path(path); msg.start(start); msg.length(len); msg.userName(userName); return io.send(msg).chain(BLOCK_LOCATION_COL_RES).get(); }
/** {@inheritDoc} */ @Override public HadoopIgfsStreamDelegate open(IgfsPath path) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(OPEN_READ); msg.path(path); msg.flag(false); msg.userName(userName); IgfsInputStreamDescriptor rmtDesc = io.send(msg).chain(STREAM_DESCRIPTOR_RES).get(); return new HadoopIgfsStreamDelegate(this, rmtDesc.streamId(), rmtDesc.length()); }
/** {@inheritDoc} */ @Override public HadoopIgfsStreamDelegate open(IgfsPath path, int seqReadsBeforePrefetch) throws IgniteCheckedException { final IgfsPathControlRequest msg = new IgfsPathControlRequest(); msg.command(OPEN_READ); msg.path(path); msg.flag(true); msg.sequentialReadsBeforePrefetch(seqReadsBeforePrefetch); msg.userName(userName); IgfsInputStreamDescriptor rmtDesc = io.send(msg).chain(STREAM_DESCRIPTOR_RES).get(); return new HadoopIgfsStreamDelegate(this, rmtDesc.streamId(), rmtDesc.length()); }