Examples of FileStats


Examples of scfs.directoryService.FileStats

    //UPDATE
    System.out.println("\t2 - UPDATE FILES.");
    for(int i = 0 ; i<NUM_IT ; i++) {
      try {
        FileStats fs = mList.get(i).getStats();
        fs.setSize(fs.getSize()+10);
        mList.get(i).setStats(fs);

        start = System.currentTimeMillis();
        dis.updateMetadata(list.get(i), mList.get(i));
        if(i>=NUM_START)
View Full Code Here

Examples of scfs.directoryService.FileStats

    int rdev = 0;
    int size = 0;
    long blocks = 0;
    int currentTime = (int) (System.currentTimeMillis() / 1000L);
    int atime = currentTime, mtime = currentTime, ctime = currentTime;
    return new FileStats(inode, mode, nlink, uid, gid, rdev, size, blocks, atime, mtime, ctime, new byte[20], nodeType == NodeType.FILE ? true : false, true);
  }
View Full Code Here

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

Examples of scfs.directoryService.FileStats

    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

Examples of scfs.directoryService.FileStats

    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

Examples of scfs.directoryService.FileStats

      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
Copyright © 2018 www.massapi.com. 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.