コード例 #1
0
 public override void Add(PipelineContext ctx)
 {
     if (mapper == null)
     {
         String id = String.Format("{0}#{1}", Name, InstanceNo);
         if (directory == null)
         {
             mapper = new MemoryBasedMapperWriters(hasher, sorter, fanOut);
         }
         else
         {
             mapper = new FileBasedMapperWriters(hasher, sorter, directory, id, fanOut, compress, keepFiles);
         }
     }
     if (accumulator.Count > 0)
     {
         ++cnt_received;
         if (!mapper.OptWrite(accumulator, maxNullIndex))
         {
             //Just passthrough to the next endpoint if this record had a failing hash-value
             ++numPassThrough;
             PassThrough(ctx, accumulator);
         }
         Clear();
     }
 }
コード例 #2
0
 public override void Add(PipelineContext ctx)
 {
     if (mapper == null)
     {
         String id = String.Format("{0}#{1}", Name, InstanceNo);
         mapper = new MemoryBasedMapperWriters(null, null, 1);
     }
     if (accumulator.Count > 0)
     {
         ++cnt_received;
         mapper.Write(accumulator);
         Clear();
     }
 }