@Test public void getTopologyLogLocal() { }
public TopologyLog getTopologyLogLocal(Topology topology, long offset, long limit) { TopologyLog topologyLog = new TopologyLog(); topologyLog.setOffset(offset); topologyLog.setCount(0); BufferedReader inputReader = null; try { inputReader = new BufferedReader(new FileReader(new File( streamflowConfig.getLogger().getBaseDir(), "topology-" + topology.getId() + ".log"))); String currentLine; long currentOffset = 0; while ((currentOffset < offset) && ((currentLine = inputReader.readLine()) != null)) { currentOffset++; } long lineCount = 0; while ((lineCount < limit) && ((currentLine = inputReader.readLine()) != null)) { topologyLog.getLines().add(currentLine); lineCount++; } topologyLog.setCount(lineCount); } catch (IOException ex) { LOG.error("Error reading log data for topology: {}", ex.getMessage()); } finally { if (inputReader != null) { try { inputReader.close(); } catch (IOException ex) { } } } return topologyLog; }
LogService { public TopologyLog getTopologyLogLocal(Topology topology, long offset, long limit) { TopologyLog topologyLog = new TopologyLog(); topologyLog.setOffset(offset); topologyLog.setCount(0); BufferedReader inputReader = null; try { inputReader = new BufferedReader(new FileReader(new File( streamflowConfig.getLogger().getBaseDir(), "topology-" + topology.getId() + ".log"))); String currentLine; long currentOffset = 0; while ((currentOffset < offset) && ((currentLine = inputReader.readLine()) != null)) { currentOffset++; } long lineCount = 0; while ((lineCount < limit) && ((currentLine = inputReader.readLine()) != null)) { topologyLog.getLines().add(currentLine); lineCount++; } topologyLog.setCount(lineCount); } catch (IOException ex) { LOG.error("Error reading log data for topology: {}", ex.getMessage()); } finally { if (inputReader != null) { try { inputReader.close(); } catch (IOException ex) { } } } return topologyLog; } }
LogService { public TopologyLog getTopologyLogLocal(Topology topology, long offset, long limit) { TopologyLog topologyLog = new TopologyLog(); topologyLog.setOffset(offset); topologyLog.setCount(0); BufferedReader inputReader = null; try { inputReader = new BufferedReader(new FileReader(new File( streamflowConfig.getLogger().getBaseDir(), "topology-" + topology.getId() + ".log"))); String currentLine; long currentOffset = 0; while ((currentOffset < offset) && ((currentLine = inputReader.readLine()) != null)) { currentOffset++; } long lineCount = 0; while ((lineCount < limit) && ((currentLine = inputReader.readLine()) != null)) { topologyLog.getLines().add(currentLine); lineCount++; } topologyLog.setCount(lineCount); } catch (IOException ex) { LOG.error("Error reading log data for topology: {}", ex.getMessage()); } finally { if (inputReader != null) { try { inputReader.close(); } catch (IOException ex) { } } } return topologyLog; } @Inject  LogService(StreamflowConfig streamflowConfig); }
LogService { public TopologyLog getTopologyLogLocal(Topology topology, long offset, long limit) { TopologyLog topologyLog = new TopologyLog(); topologyLog.setOffset(offset); topologyLog.setCount(0); BufferedReader inputReader = null; try { inputReader = new BufferedReader(new FileReader(new File( streamflowConfig.getLogger().getBaseDir(), "topology-" + topology.getId() + ".log"))); String currentLine; long currentOffset = 0; while ((currentOffset < offset) && ((currentLine = inputReader.readLine()) != null)) { currentOffset++; } long lineCount = 0; while ((lineCount < limit) && ((currentLine = inputReader.readLine()) != null)) { topologyLog.getLines().add(currentLine); lineCount++; } topologyLog.setCount(lineCount); } catch (IOException ex) { LOG.error("Error reading log data for topology: {}", ex.getMessage()); } finally { if (inputReader != null) { try { inputReader.close(); } catch (IOException ex) { } } } return topologyLog; } @Inject  LogService(StreamflowConfig streamflowConfig); TopologyLog getTopologyLogLocal(Topology topology, long offset, long limit); TopologyLogPage getTopologyLogCluster(Topology topology, Cluster cluster,
            TopologyLogCriteria criteria); void clearTopologyLog(Topology topology, Cluster cluster); }
LogService { public TopologyLog getTopologyLogLocal(Topology topology, long offset, long limit) { TopologyLog topologyLog = new TopologyLog(); topologyLog.setOffset(offset); topologyLog.setCount(0); BufferedReader inputReader = null; try { inputReader = new BufferedReader(new FileReader(new File( streamflowConfig.getLogger().getBaseDir(), "topology-" + topology.getId() + ".log"))); String currentLine; long currentOffset = 0; while ((currentOffset < offset) && ((currentLine = inputReader.readLine()) != null)) { currentOffset++; } long lineCount = 0; while ((lineCount < limit) && ((currentLine = inputReader.readLine()) != null)) { topologyLog.getLines().add(currentLine); lineCount++; } topologyLog.setCount(lineCount); } catch (IOException ex) { LOG.error("Error reading log data for topology: {}", ex.getMessage()); } finally { if (inputReader != null) { try { inputReader.close(); } catch (IOException ex) { } } } return topologyLog; } @Inject  LogService(StreamflowConfig streamflowConfig); TopologyLog getTopologyLogLocal(Topology topology, long offset, long limit); TopologyLogPage getTopologyLogCluster(Topology topology, Cluster cluster,
            TopologyLogCriteria criteria); void clearTopologyLog(Topology topology, Cluster cluster);  }