Examples of FileSystemInfo


Examples of org.platformlayer.ops.filesystem.FilesystemInfo

  public void handler() throws OpsException, IOException {
    // TODO: Only if not installed
    OpsTarget target = OpsContext.get().getInstance(OpsTarget.class);

    File cgroupsFile = new File("/cgroup");
    FilesystemInfo info = target.getFilesystemInfoFile(cgroupsFile);
    if (info != null) {
      // TODO: Better idempotency
      return;
    }
View Full Code Here

Examples of org.platformlayer.ops.filesystem.FilesystemInfo

  }

  @Override
  protected boolean alreadyExists() throws OpsException {
    OpsTarget target = OpsContext.get().getInstance(OpsTarget.class);
    FilesystemInfo dirInfo = target.getFilesystemInfoFile(new File(getDataDirectory(), "objectClass.bdb"));

    return dirInfo != null;
  }
View Full Code Here

Examples of org.platformlayer.ops.filesystem.FilesystemInfo

  public File srcDir;
  public File iso;

  @Handler
  public void handler(OpsTarget target) throws OpsException {
    FilesystemInfo isoInfo = target.getFilesystemInfoFile(iso);

    boolean rebuild = true;
    if (isoInfo != null) {
      // TODO: Do timestamp based dependency checking?
      rebuild = false;
View Full Code Here

Examples of org.platformlayer.ops.filesystem.FilesystemInfo

    if (buildTar) {
      Command compress = Command.build("cd {0}; tar jcf {1} .", rootfsDir, imageFile);
      target.executeCommand(compress.setTimeout(TimeSpan.FIFTEEN_MINUTES));
    }

    FilesystemInfo imageInfo = target.getFilesystemInfoFile(imageFile);

    File uploadImageFile;

    if (!buildTar) {
      boolean isQcow2 = imageFormat == ImageFormat.DiskQcow2;
View Full Code Here

Examples of org.platformlayer.ops.filesystem.FilesystemInfo

      String[] fieldValues = line.split("\t");
      if (fieldValues.length != fields.length) {
        throw new OpsException("Cannot parse line: " + line);
      }

      FilesystemInfo filesystemInfo = new FilesystemInfo();

      for (int i = 0; i < fieldValues.length; i++) {
        String field = fields[i];
        String fieldValue = fieldValues[i];
        if (field.equals("u")) {
View Full Code Here

Examples of org.platformlayer.ops.filesystem.FilesystemInfo

  }

  private File checkDirectory(File base, Md5Hash hash, int splits) throws OpsException {
    String relativePath = toRelativePath(hash, splits);
    File seedFile = new File(base, relativePath);
    FilesystemInfo seedFileInfo = host.getFilesystemInfoFile(seedFile);
    if (seedFileInfo != null) {
      Md5Hash seedFileHash = host.getFileHash(seedFile);
      if (!seedFileHash.equals(hash)) {
        log.warn("Hash mismatch on file: " + seedFile);
        return null;
View Full Code Here

Examples of org.platformlayer.ops.filesystem.FilesystemInfo

  }

  @Override
  public void release(PlatformLayerKey owner, T item) throws OpsException {
    File symlink = new File(assignedDir, toKey(item));
    FilesystemInfo info = target.getFilesystemInfoFile(symlink);
    if (info == null) {
      throw new OpsException("Symlink not found");
    }

    if (!Objects.equal(info.symlinkTarget, toFile(owner).getAbsolutePath())) {
View Full Code Here

Examples of org.rhq.core.system.FileSystemInfo

        long totalFreeDiskSpace = 0;
        long totalUsedDiskSpace = 0;

        for (String path : paths) {
            try {
                FileSystemInfo fileSystemInfo  = this.getResourceContext().getSystemInformation().getFileSystem(path);
                if (!visitedMountPoints.contains(fileSystemInfo.getMountPoint())) {
                    visitedMountPoints.add(fileSystemInfo.getMountPoint());

                    //contrary to Sigar documentation this values are reported in MB and not bytes
                    totalDiskSpace += fileSystemInfo.getFileSystemUsage().getTotal();
                    totalFreeDiskSpace += fileSystemInfo.getFileSystemUsage().getFree();
                    totalUsedDiskSpace += fileSystemInfo.getFileSystemUsage().getUsed();
                }
            } catch (Exception e) {
                log.error("Unable to determine file system usage information for data file location " + path, e);
            }
        }
View Full Code Here

Examples of org.rhq.core.system.FileSystemInfo

    public void stop() {
    }

    public AvailabilityType getAvailability() {
        FileSystemInfo fileSystemInfo = getFileSystemInfo();
        if (fileSystemInfo != null && fileSystemInfo.getFileSystem() != null
            && this.resourceContext.getResourceKey().equals(fileSystemInfo.getFileSystem().getDirName())) {
            return AvailabilityType.UP;
        } else {
            return AvailabilityType.DOWN;
        }
    }
View Full Code Here

Examples of org.rhq.core.system.FileSystemInfo

            return AvailabilityType.DOWN;
        }
    }

    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) throws Exception {
        FileSystemInfo fileSystemInfo = getFileSystemInfo();
        for (MeasurementScheduleRequest request : requests) {
            try {
                switch (request.getDataType()) {
                    case TRAIT:
                        Object object = ObjectUtil.lookupDeepAttributeProperty(fileSystemInfo, request.getName());
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.