Package scfs.directoryService

Examples of scfs.directoryService.FileStats


      } catch (DirectoryServiceException e1) {
        throw new FuseException(e1.getMessage()).initErrno(FuseException.ENOENT);
      }
      Statistics.incGetMeta(System.currentTimeMillis()-time);
    }
    FileStats stats = metadata.getStats();
    getattrSetter.set(stats.getInode(), stats.getMode(), stats.getNlink(), Integer.parseInt(System.getProperty("uid")), Integer.parseInt(System.getProperty("gid")),
        stats.getRdev(), stats.getSize(), stats.getBlocks(), stats.getAtime(),
        stats.getMtime(), stats.getCtime());

    return 0;
  }
View Full Code Here


    try {

      String[] vec = dividePath(path);
      String idPath = getNextIdPath();
      FileStats fs = createDefaultFileStats(NodeType.DIR, Long.parseLong(idPath), mode);
      NodeMetadata m = new NodeMetadata(NodeType.DIR, vec[0], vec[1], fs, idPath, defaultKey, new int[]{clientId}, new int[]{clientId});

      long time = System.currentTimeMillis();
      directoryService.putMetadata(m);
      Statistics.incPutMeta(System.currentTimeMillis()-time);
View Full Code Here

    try {
      String[] vec = dividePath(path);
      String idPath = getNextIdPath();

      FileStats fs = createDefaultFileStats(NodeType.FILE, Long.parseLong(idPath), mode);
      fs.setMode(mode);
      fs.setRdev(rdev);
      NodeMetadata m = new NodeMetadata(NodeType.FILE, vec[0], vec[1], fs, idPath, MyAESCipher.generateSecretKey(), new int[]{clientId}, new int[]{clientId});

      long time = System.currentTimeMillis();
      directoryService.putMetadata(m);
      Statistics.incPutMeta(System.currentTimeMillis()-time);
View Full Code Here

      if (mode == metadata.getStats().getMode())
        return 0;

      try {
        FileStats fs = metadata.getStats();
        fs.setMode(mode);
        NodeMetadata node = new NodeMetadata(metadata.getNodeType(), metadata.getParent(), metadata.getName(), fs, metadata.getId_path(), metadata.getKey(), ((mode & SCFSConstants.S_IRGRP) == 0 && (mode & SCFSConstants.S_IROTH) == 0) ? new int[] { clientId } : null, metadata.getC_w());

        if(isInPNS){
          namespace.updateMetadata(path, node);
        }else{
          long time = System.currentTimeMillis();
          directoryService.updateMetadata(path, node);
          Statistics.incUpdateMeta(System.currentTimeMillis() - time);
        }
      } catch (DirectoryServiceConnectionProblemException e) {
        throw new FuseException(e.getMessage()).initErrno(FuseException.ECONNABORTED);
      } catch (DirectoryServiceException e) {
        e.printStackTrace();
        throw new FuseException(e.getMessage()).initErrno(FuseException.ECONNABORTED);
      }
    }else{
      try {
        long time = System.currentTimeMillis();
        metadata = directoryService.getMetadata(path);
        Statistics.incGetMeta(System.currentTimeMillis() - time);

        if (mode == metadata.getStats().getMode())
          return 0;

        FileStats fs = metadata.getStats();
        fs.setMode(mode);
        NodeMetadata node = new NodeMetadata(metadata.getNodeType(), metadata.getParent(), metadata.getName(), fs, metadata.getId_path(), metadata.getKey(), ((mode & SCFSConstants.S_IRGRP) == 0 && (mode & SCFSConstants.S_IROTH) == 0) ? new int[] { clientId } : null, metadata.getC_w());

        time = System.currentTimeMillis();
        directoryService.updateMetadata(path, node);
        Statistics.incUpdateMeta(System.currentTimeMillis() - time);
View Full Code Here

TOP

Related Classes of scfs.directoryService.FileStats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.