Package org.neo4j.batchimport.utils

Examples of org.neo4j.batchimport.utils.Chunker


        for (int i = 0; i < relTypesCount; i++) relTypeIds[i] = inserter.getRelTypeId(relTypes[i]);
    }

    private void initReader() throws IOException {
        nodesReader = new BufferedReader(readerFor(nodesFile), MEGABYTE);
        nodeChunker = new Chunker(nodesReader, delim);

        relsReader = new BufferedReader(readerFor(relationshipsFile), MEGABYTE);
        relChunker = new Chunker(relsReader, delim);
    }
View Full Code Here


public class ChunkerLineData extends AbstractLineData {
    private final Chunker chunker;

    public ChunkerLineData(Reader reader, char delim, int offset) {
        super(offset);
        chunker = new Chunker(reader, delim);
        initHeaders(createHeaders(readRawRow()));
        createMapData(lineSize, offset);
    }
View Full Code Here

    @Test
    public void testReadHeader() throws Exception {
        final BufferedReader reader = new BufferedReader(new StringReader(file));
        final String[] header = reader.readLine().split("\t");
        final Chunker chunker = new Chunker(reader, '\t');
        readLine(header, chunker, "FOO", "42");
        readLine(header, chunker, "", "42");
        assertEquals(Chunker.EOF,chunker.nextWord());
    }
View Full Code Here

    }

    @Test
    public void testPerformance() throws Exception {
        final BufferedReader reader = new BufferedReader(new FileReader(PerformanceTestFile.TEST_CSV));
        final Chunker chunker = new Chunker(reader, '\t');

        int res = 0;
        long time = System.currentTimeMillis();
        String token;
        while ( (token = chunker.nextWord()) != Chunker.EOF)  {
            if (token!=Chunker.NO_VALUE && token != Chunker.EOL) res++;
        }
        time = System.currentTimeMillis() - time;
        System.out.println("time = " + time + " ms.");
        Assert.assertEquals((PerformanceTestFile.ROWS) * PerformanceTestFile.COLS, res);
View Full Code Here

TOP

Related Classes of org.neo4j.batchimport.utils.Chunker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.