Пример #1
0
 private void InitializeInstanceFields()
 {
     _extractors = new Extractors(_configuration.arrayDelimiter());
     _entry1     = new Header.Entry(null, Type.StartId, null, _extractors.int_());
     _entry2     = new Header.Entry(null, Type.Type, null, _extractors.@string());
     _entry3     = new Header.Entry(null, Type.EndId, null, _extractors.int_());
 }
Пример #2
0
 public LazyCsvInputChunk(IdType idType, int delimiter, Collector badCollector, Extractors extractors, Source_Chunk processingChunk, Configuration config, Decorator decorator, Header header)
 {
     this._idType          = idType;
     this._badCollector    = badCollector;
     this._extractors      = extractors;
     this._delimiter       = delimiter;
     this._processingChunk = processingChunk;
     this._config          = config;
     this._decorator       = decorator;
     this._header          = header;
 }
Пример #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: CsvInputIterator(org.neo4j.csv.reader.CharReadable stream, Decorator decorator, Header.Factory headerFactory, IdType idType, Configuration config, org.neo4j.unsafe.impl.batchimport.input.Groups groups, org.neo4j.unsafe.impl.batchimport.input.Collector badCollector, org.neo4j.csv.reader.Extractors extractors, int groupId) throws java.io.IOException
        internal CsvInputIterator(CharReadable stream, Decorator decorator, Header.Factory headerFactory, IdType idType, Configuration config, Groups groups, Collector badCollector, Extractors extractors, int groupId) : this(stream, decorator, ExtractHeader(stream, headerFactory, idType, config, groups), config, idType, badCollector, extractors, groupId)
        {
        }
Пример #4
0
        internal CsvInputIterator(CharReadable stream, Decorator decorator, Header header, Configuration config, IdType idType, Collector badCollector, Extractors extractors, int groupId)
        {
            this._stream    = stream;
            this._decorator = decorator;
            this._groupId   = groupId;
            if (config.multilineFields())
            {
                // If we're expecting multi-line fields then there's no way to arbitrarily chunk the underlying data source
                // and find record delimiters with certainty. This is why we opt for a chunker that does parsing inside
                // the call that normally just hands out an arbitrary amount of characters to parse outside and in parallel.
                // This chunker is single-threaded, as it was previously too and keeps the functionality of multi-line fields.
                this._chunker = new EagerParserChunker(stream, idType, header, badCollector, extractors, 1_000, config, decorator);
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                this._realInputChunkSupplier = EagerCsvInputChunk::new;
            }
            else
            {
                this._chunker = new ClosestNewLineChunker(stream, config.bufferSize());
                this._realInputChunkSupplier = () => new LazyCsvInputChunk(idType, config.delimiter(), badCollector, extractors(config), _chunker.newChunk(), config, decorator, header);
            }
        }
Пример #5
0
 public EagerParserChunker(CharReadable reader, IdType idType, Header header, Collector badCollector, Extractors extractors, int chunkSize, Configuration config, Decorator decorator)
 {
     this._chunkSize = chunkSize;
     this._decorator = decorator;
     this._seeker    = charSeeker(reader, config, true);
     this._parser    = new CsvInputParser(_seeker, config.delimiter(), idType, header, badCollector, extractors);
 }