Search in sources :

Example 1 with GraphSet

use of org.apache.geode.internal.sequencelog.model.GraphSet in project geode by apache.

the class GraphReader method readGraphs.

public GraphSet readGraphs(Filter filter, boolean areGemfireLogs) throws IOException {
    GraphSet graphs = new GraphSet();
    if (areGemfireLogs) {
        // TODO - probably don't need to go all the way
        // to a binary format here, but this is quick and easy.
        HeapDataOutputStream out = new HeapDataOutputStream(Version.CURRENT);
        GemfireLogConverter.convertFiles(out, files);
        InputStreamReader reader = new InputStreamReader(out.getInputStream());
        reader.addToGraphs(graphs, filter);
    } else {
        for (File file : files) {
            FileInputStream fis = new FileInputStream(file);
            InputStreamReader reader = new InputStreamReader(fis);
            reader.addToGraphs(graphs, filter);
        }
    }
    graphs.readingDone();
    return graphs;
}
Also used : HeapDataOutputStream(org.apache.geode.internal.HeapDataOutputStream) File(java.io.File) GraphSet(org.apache.geode.internal.sequencelog.model.GraphSet) FileInputStream(java.io.FileInputStream)

Aggregations

File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 HeapDataOutputStream (org.apache.geode.internal.HeapDataOutputStream)1 GraphSet (org.apache.geode.internal.sequencelog.model.GraphSet)1