@Override public RollingLogs createRollingLogs(String bpid, String prefix ) throws IOException { String dir = null; final List<FsVolumeImpl> volumes = getVolumes(); for (FsVolumeImpl vol : volumes) { String bpDir = vol.getPath(bpid); if (RollingLogsImpl.isFilePresent(bpDir, prefix)) { dir = bpDir; break; } } if (dir == null) { dir = volumes.get(0).getPath(bpid); } return new RollingLogsImpl(dir, prefix); }
@Override public RollingLogs createRollingLogs(String bpid, String prefix) throws IOException { String dir = null; final List<FsVolumeImpl> volumes = getVolumes(); for (FsVolumeImpl vol : volumes) { String bpDir = vol.getPath(bpid); if (RollingLogsImpl.isFilePresent(bpDir, prefix)) { dir = bpDir; break; } } if (dir == null) { dir = volumes.get(0).getPath(bpid); } return new RollingLogsImpl(dir, prefix); }
private LogFileHandler(RollingLogs logs) { this.logs = logs; }
@Override public RollingLogs createRollingLogs(String bpid, String prefix) { throw new UnsupportedOperationException(); }