Search in sources :

Example 1 with RecordStore

use of org.neo4j.kernel.impl.store.RecordStore in project neo4j by neo4j.

the class RsdrMain method read.

private static void read(FileSystemAbstraction fileSystem, String cmd, NeoStores neoStores) throws IOException {
    Matcher matcher = readCommandPattern.matcher(cmd);
    if (matcher.find()) {
        String lower = matcher.group("lower");
        String upper = matcher.group("upper");
        String fname = matcher.group("fname");
        String regex = matcher.group("regex");
        Pattern pattern = regex != null ? Pattern.compile(regex) : null;
        long fromId = lower != null ? Long.parseLong(lower) : 0L;
        long toId = upper != null ? Long.parseLong(upper) : Long.MAX_VALUE;
        RecordStore store = getStore(fname, neoStores);
        if (store != null) {
            readStore(fileSystem, store, fromId, toId, pattern);
            return;
        }
        IOCursor<LogEntry> cursor = getLogCursor(fileSystem, fname, neoStores);
        if (cursor != null) {
            readLog(cursor, fromId, toId, pattern);
            cursor.close();
            return;
        }
        console.printf("don't know how to read '%s'%n", fname);
    } else {
        console.printf("bad read command format%n");
    }
}
Also used : Pattern(java.util.regex.Pattern) Matcher(java.util.regex.Matcher) RecordStore(org.neo4j.kernel.impl.store.RecordStore) LogEntry(org.neo4j.kernel.impl.transaction.log.entry.LogEntry)

Aggregations

Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 RecordStore (org.neo4j.kernel.impl.store.RecordStore)1 LogEntry (org.neo4j.kernel.impl.transaction.log.entry.LogEntry)1