Search in sources :

Example 1 with IgfsClientSetTimesCallable

use of org.apache.ignite.internal.processors.igfs.client.IgfsClientSetTimesCallable in project ignite by apache.

the class IgfsImpl method setTimes.

/** {@inheritDoc} */
@Override
public void setTimes(final IgfsPath path, final long modificationTime, final long accessTime) {
    A.notNull(path, "path");
    if (accessTime == -1 && modificationTime == -1)
        return;
    if (meta.isClient()) {
        meta.runClientTask(new IgfsClientSetTimesCallable(cfg.getName(), IgfsUserContext.currentUser(), path, accessTime, modificationTime));
        return;
    }
    safeOp(new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            IgfsMode mode = resolveMode(path);
            if (mode == PROXY)
                secondaryFs.setTimes(path, modificationTime, accessTime);
            else {
                meta.updateTimes(path, modificationTime, accessTime, IgfsUtils.isDualMode(mode) ? secondaryFs : null);
            }
            return null;
        }
    });
}
Also used : IgfsMode(org.apache.ignite.igfs.IgfsMode) IgfsClientSetTimesCallable(org.apache.ignite.internal.processors.igfs.client.IgfsClientSetTimesCallable) IgfsPathIsDirectoryException(org.apache.ignite.igfs.IgfsPathIsDirectoryException) IgfsInvalidPathException(org.apache.ignite.igfs.IgfsInvalidPathException) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) IgfsException(org.apache.ignite.igfs.IgfsException) IgfsPathNotFoundException(org.apache.ignite.igfs.IgfsPathNotFoundException)

Aggregations

IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteException (org.apache.ignite.IgniteException)1 IgfsException (org.apache.ignite.igfs.IgfsException)1 IgfsInvalidPathException (org.apache.ignite.igfs.IgfsInvalidPathException)1 IgfsMode (org.apache.ignite.igfs.IgfsMode)1 IgfsPathIsDirectoryException (org.apache.ignite.igfs.IgfsPathIsDirectoryException)1 IgfsPathNotFoundException (org.apache.ignite.igfs.IgfsPathNotFoundException)1 IgfsClientSetTimesCallable (org.apache.ignite.internal.processors.igfs.client.IgfsClientSetTimesCallable)1