gpt4 book ai didi

org.jvnet.solaris.libzfs.ZFSFileSystem类的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 00:01:31 24 4
gpt4 key购买 nike

本文整理了Java中org.jvnet.solaris.libzfs.ZFSFileSystem类的一些代码示例,展示了ZFSFileSystem类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZFSFileSystem类的具体详情如下:
包路径:org.jvnet.solaris.libzfs.ZFSFileSystem
类名称:ZFSFileSystem

ZFSFileSystem介绍

[英]ZFS file system.
[中]ZFS文件系统。

代码示例

代码示例来源:origin: jenkinsci/jenkins

return existing.getName();
hudson.setMountPoint(dir);
hudson.mount();
if(LIBC.chown(dir.getPath(),uid,gid)!=0)
  throw new IOException("Failed to chown "+dir);
hudson.unmount();
  hudson.setProperty("hudson:managed-by","hudson"); // mark this file system as "managed by Hudson"
  hudson.allow(acl);
} catch (ZFSException e) {
    hudson.destory();
  } catch (Exception ignored) {
return hudson.getName();

代码示例来源:origin: jenkinsci/jenkins

hudson.setMountPoint(tmpDir);
hudson.setProperty("hudson:managed-by","hudson"); // mark this file system as "managed by Hudson"
hudson.mount();
hudson.unmount(MountFlags.MS_FORCE);
hudson.setMountPoint(home);
hudson.mount();
  hudson.setProperty("sharesmb","on");
  hudson.setProperty("sharenfs","on");
  hudson.share();
} catch (ZFSException e) {
  listener.error("Failed to share the file systems: "+e.getCode());

代码示例来源:origin: jenkinsci/jenkins

@Override
    public Void invoke(File f, VirtualChannel channel) throws IOException {
      ZFSFileSystem fs = libzfs.getFileSystemByMountPoint(f);
      if(fs!=null)    return null;    // already on ZFS
      // nope. create a file system
      String fullName = rootDataset + '/' + name;
      listener.getLogger().println("Creating a ZFS file system "+fullName+" at "+f);
      fs = libzfs.create(fullName, ZFSFileSystem.class);
      fs.setMountPoint(f);
      fs.mount();
      return null;
    }
}

代码示例来源:origin: jenkinsci/jenkins

private static String computeHudsonFileSystemName(LibZFS zfs, ZFSFileSystem top) {
  if(!zfs.exists(top.getName()+"/hudson"))
    return top.getName()+"/hudson";
  for( int i=2; ; i++ ) {
    String name = top.getName() + "/hudson" + i;
    if(!zfs.exists(name))
      return name;
  }
}

代码示例来源:origin: org.kohsuke/libzfs

/**
 * Creates a clone from this snapshot.
 * 
 * This method fails if this {@link ZFSObject} is not a snapshot.
 */
public ZFSFileSystem clone(String fullDestinationName) {
  if (LIBZFS.zfs_clone(handle, fullDestinationName, null) != 0)
    throw new ZFSException(library);
  ZFSFileSystem target = (ZFSFileSystem) library.open(fullDestinationName);
  // this behavior mimics "zfs clone"
  target.mount();
  target.share();
  return target;
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * Unmounts this file system.
 */
public void unmount() {
  unmount(0);
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * Mounts this file system.
 */
public void mount() {
  mount(0);
}

代码示例来源:origin: org.hudsonci.plugins/jna-native-support-plugin

public void setProperty(String key, String value) {
  zfsFileSystem.setProperty(key, value);
}

代码示例来源:origin: org.kohsuke/libzfs

public static void main(String[] args) {
    LibZFS zfs = new LibZFS();
    for (ZFSFileSystem fs : zfs.roots()) {
      System.out.println(fs.getName());
      for (ZFSFileSystem c : fs.children(ZFSFileSystem.class)) {
        System.out.println(c.getName());
      }
    }
  }
}

代码示例来源:origin: jenkinsci/jenkins

@Override
    public Void invoke(File f, VirtualChannel channel) throws IOException {
      ZFSFileSystem fs = libzfs.getFileSystemByMountPoint(f);
      if(fs!=null)
        fs.destory(true);
      return null;
    }
}

代码示例来源:origin: org.hudsonci.plugins/jna-native-support-plugin

public void share() {
  zfsFileSystem.share();
}

代码示例来源:origin: org.hudsonci.plugins/jna-native-support-plugin

public void setMountPoint(File dir) {
  zfsFileSystem.setMountPoint(dir);
}

代码示例来源:origin: org.kohsuke/libzfs

public int callback(zfs_handle_t handle, Pointer arg) {
    r.add(new ZFSFileSystem(LibZFS.this, handle));
    return 0;
  }
}, null);

代码示例来源:origin: org.hudsonci.plugins/jna-native-support-plugin

public void allow(String userName) {
  ACLBuilder acl = new ACLBuilder();
  acl.user(userName).withEverything();
  zfsFileSystem.allow(acl);
}

代码示例来源:origin: org.kohsuke/libzfs

public <T extends ZFSObject> List<T> descendants(Class<T> type) {
  ArrayList<T> r = new ArrayList<T>();
  r.addAll(children(type));
  for (ZFSFileSystem p : roots())
    r.addAll(p.descendants(type));
  return r;
}

代码示例来源:origin: jenkinsci/jenkins

@Override
    public String invoke(File f, VirtualChannel channel) throws IOException {
      ZFSFileSystem fs = libzfs.getFileSystemByMountPoint(f);
      if(fs!=null)    return fs.getName();
      // TODO: for now, only support agents that are already on ZFS.
      throw new IOException("Not on ZFS");
    }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

public Void invoke(File f, VirtualChannel channel) throws IOException {
    ZFSFileSystem fs = libzfs.getFileSystemByMountPoint(f);
    if(fs!=null)    return null;    // already on ZFS
    // nope. create a file system
    String fullName = rootDataset + '/' + name;
    listener.getLogger().println("Creating a ZFS file system "+fullName+" at "+f);
    fs = libzfs.create(fullName, ZFSFileSystem.class);
    fs.setMountPoint(f);
    fs.mount();
    return null;
  }
});

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * Creates a clone from this snapshot.
 * 
 * This method fails if this {@link ZFSObject} is not a snapshot.
 */
public ZFSFileSystem clone(String fullDestinationName) {
  if (LIBZFS.zfs_clone(handle, fullDestinationName, null) != 0)
    throw new ZFSException(library);
  ZFSFileSystem target = (ZFSFileSystem) library.open(fullDestinationName);
  // this behavior mimics "zfs clone"
  target.mount();
  target.share();
  return target;
}

代码示例来源:origin: org.kohsuke/libzfs

/**
 * Unmounts this file system.
 */
public void unmount() {
  unmount(0);
}

代码示例来源:origin: org.kohsuke/libzfs

/**
 * Mounts this file system.
 */
public void mount() {
  mount(0);
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com