@Override public Object getAttribute(String attribute) throws IOException { switch(attribute) { // for the partition case "lucene:major_device_number": return majorDeviceNumber; case "lucene:minor_device_number": return minorDeviceNumber; default: return in.getAttribute(attribute); } }
public NodePath(Path path) throws IOException { this.path = path; this.indicesPath = path.resolve(INDICES_FOLDER); this.fileStore = Environment.getFileStore(path); if (fileStore.supportsFileAttributeView("lucene")) { this.majorDeviceNumber = (int) fileStore.getAttribute("lucene:major_device_number"); this.minorDeviceNumber = (int) fileStore.getAttribute("lucene:minor_device_number"); } else { this.majorDeviceNumber = -1; this.minorDeviceNumber = -1; } }
@Override public Object getAttribute(String attribute) throws IOException { switch(attribute) { // for the partition case "lucene:major_device_number": return majorDeviceNumber; case "lucene:minor_device_number": return minorDeviceNumber; default: return in.getAttribute(attribute); } }
@Override public Object getAttribute(String attribute) throws IOException { switch(attribute) { // for the device case "lucene:spins": return spins; // for the partition case "lucene:major_device_number": return majorDeviceNumber; case "lucene:minor_device_number": return minorDeviceNumber; default: return in.getAttribute(attribute); } }
@Override public Object getAttribute(String attribute) throws IOException { return fileStore.getAttribute(attribute); } }
@Override public Object getAttribute(String attribute) throws IOException { return fileStore.getAttribute(attribute); } }
@Override public Object getAttribute(String attribute) throws IOException { switch(attribute) { // for the partition case "lucene:major_device_number": return majorDeviceNumber; case "lucene:minor_device_number": return minorDeviceNumber; default: return in.getAttribute(attribute); } }
@Override public Object getAttribute(String attribute) throws IOException { return fileStore.getAttribute(attribute); } }
@Override public Object getAttribute(String attribute) throws IOException { return origFileStore.getAttribute(attribute); }
@Override public Object getAttribute(String attribute) throws IOException { if ("lucene:spins".equals(attribute)) { return spins; } else { return in.getAttribute(attribute); } }
for (FileStore store: FileSystems.getDefault().getFileStores()) { System.out.format("%-20s vsn:%s\n", store, store.getAttribute("volume:vsn")); }
public NodePath(Path path) throws IOException { this.path = path; this.indicesPath = path.resolve(INDICES_FOLDER); this.fileStore = Environment.getFileStore(path); if (fileStore.supportsFileAttributeView("lucene")) { this.spins = (Boolean) fileStore.getAttribute("lucene:spins"); this.majorDeviceNumber = (int) fileStore.getAttribute("lucene:major_device_number"); this.minorDeviceNumber = (int) fileStore.getAttribute("lucene:minor_device_number"); } else { this.spins = null; this.majorDeviceNumber = -1; this.minorDeviceNumber = -1; } }
public NodePath(Path path) throws IOException { this.path = path; this.indicesPath = path.resolve(INDICES_FOLDER); this.fileStore = Environment.getFileStore(path); if (fileStore.supportsFileAttributeView("lucene")) { this.majorDeviceNumber = (int) fileStore.getAttribute("lucene:major_device_number"); this.minorDeviceNumber = (int) fileStore.getAttribute("lucene:minor_device_number"); } else { this.majorDeviceNumber = -1; this.minorDeviceNumber = -1; } }
public NodePath(Path path) throws IOException { this.path = path; this.indicesPath = path.resolve(INDICES_FOLDER); this.fileStore = Environment.getFileStore(path); if (fileStore.supportsFileAttributeView("lucene")) { this.majorDeviceNumber = (int) fileStore.getAttribute("lucene:major_device_number"); this.minorDeviceNumber = (int) fileStore.getAttribute("lucene:minor_device_number"); } else { this.majorDeviceNumber = -1; this.minorDeviceNumber = -1; } }
public NodePath(Path path, Environment environment) throws IOException { this.path = path; this.indicesPath = path.resolve(INDICES_FOLDER); this.fileStore = environment.getFileStore(path); if (fileStore.supportsFileAttributeView("lucene")) { this.spins = (Boolean) fileStore.getAttribute("lucene:spins"); } else { this.spins = null; } }
@Test(expected = UnsupportedOperationException.class) public void getAttribute() throws IOException { this.fileStore.getAttribute("something"); }