示例#1
0
 public MvcHtmlString Header(Func<object, HelperResult> action)
 {
     TextWriter writer = _context.Writer;
     var buffer = new RecordWriter(writer);
     action(null).WriteTo(buffer);
     return _helper.Partial(PartialViewPath("Header"), buffer.Builder);
 }
示例#2
0
 internal override void WriteField(RecordWriter writer)
 {
     foreach (var formId in List)
     {
         writer.WriteReference(formId, FormKindSet.Any);
     }
 }
示例#3
0
        protected override void BeforeWrite(RecordWriter writer)
        {
            // Sync KISZ before saving
            if (Data == null || Data.List.Count == 0)
            {
                Size = null;

                // Also unset empty Data if instantiated and empty
                // to prevent the creation of an empty KWDA segment
                Data = null;
            }
            else
            {
                Size = Data.List.Count;
            }
        }
        /// <exception cref="System.Exception"/>
        private void TestRecoveryInternal(int commitVersion, int recoveryVersion)
        {
            JobConf conf = new JobConf();

            FileOutputFormat.SetOutputPath(conf, outDir);
            conf.Set(JobContext.TaskAttemptId, attempt);
            conf.SetInt(MRConstants.ApplicationAttemptId, 1);
            conf.SetInt(FileOutputCommitter.FileoutputcommitterAlgorithmVersion, commitVersion
                        );
            JobContext          jContext  = new JobContextImpl(conf, ((JobID)taskID.GetJobID()));
            TaskAttemptContext  tContext  = new TaskAttemptContextImpl(conf, taskID);
            FileOutputCommitter committer = new FileOutputCommitter();

            // setup
            committer.SetupJob(jContext);
            committer.SetupTask(tContext);
            // write output
            TextOutputFormat theOutputFormat = new TextOutputFormat();
            RecordWriter     theRecordWriter = theOutputFormat.GetRecordWriter(null, conf, partFile
                                                                               , null);

            WriteOutput(theRecordWriter, tContext);
            // do commit
            if (committer.NeedsTaskCommit(tContext))
            {
                committer.CommitTask(tContext);
            }
            Path     jobTempDir1 = committer.GetCommittedTaskPath(tContext);
            FilePath jtd1        = new FilePath(jobTempDir1.ToUri().GetPath());

            if (commitVersion == 1)
            {
                NUnit.Framework.Assert.IsTrue("Version 1 commits to temporary dir " + jtd1, jtd1.
                                              Exists());
                ValidateContent(jobTempDir1);
            }
            else
            {
                NUnit.Framework.Assert.IsFalse("Version 2 commits to output dir " + jtd1, jtd1.Exists
                                                   ());
            }
            //now while running the second app attempt,
            //recover the task output from first attempt
            JobConf conf2 = new JobConf(conf);

            conf2.Set(JobContext.TaskAttemptId, attempt);
            conf2.SetInt(MRConstants.ApplicationAttemptId, 2);
            conf2.SetInt(FileOutputCommitter.FileoutputcommitterAlgorithmVersion, recoveryVersion
                         );
            JobContext          jContext2  = new JobContextImpl(conf2, ((JobID)taskID.GetJobID()));
            TaskAttemptContext  tContext2  = new TaskAttemptContextImpl(conf2, taskID);
            FileOutputCommitter committer2 = new FileOutputCommitter();

            committer2.SetupJob(jContext2);
            committer2.RecoverTask(tContext2);
            Path     jobTempDir2 = committer2.GetCommittedTaskPath(tContext2);
            FilePath jtd2        = new FilePath(jobTempDir2.ToUri().GetPath());

            if (recoveryVersion == 1)
            {
                NUnit.Framework.Assert.IsTrue("Version 1 recovers to " + jtd2, jtd2.Exists());
                ValidateContent(jobTempDir2);
            }
            else
            {
                NUnit.Framework.Assert.IsFalse("Version 2 commits to output dir " + jtd2, jtd2.Exists
                                                   ());
                if (commitVersion == 1)
                {
                    NUnit.Framework.Assert.IsTrue("Version 2  recovery moves to output dir from " + jtd1
                                                  , jtd1.List().Length == 0);
                }
            }
            committer2.CommitJob(jContext2);
            ValidateContent(outDir);
            FileUtil.FullyDelete(new FilePath(outDir.ToString()));
        }
示例#5
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.WriteReference(Sound, FormKindSet.SndrOrSoun);
     writer.Write((int)Type);
 }
示例#6
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write((uint)BodyParts);
     writer.Write((uint)SkillUsage);
 }
示例#7
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(EyeAdaptSpeed);
     writer.Write(BloomBlurRadius);
     writer.Write(BloomThreshold);
     writer.Write(BloomScale);
     writer.Write(ReceiveBloomThreshold);
     writer.Write(White);
     writer.Write(SunlightScale);
     writer.Write(SkyScale);
     writer.Write(EyeAdaptStrength);
 }
示例#8
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Version);
     writer.Write(NumRecords);
     writer.Write(NextFormId);
 }
示例#9
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Strength);
     writer.Write(Distance);
     writer.Write(Range);
     writer.Write(Radius);
     if (Unknown1 != float.NaN || Unknown2 != float.NaN)
     {
         writer.Write(Unknown1);
         writer.Write(Unknown2);
     }
 }
示例#10
0
        /// <summary>
        /// Create a reduce context that is based on ChainMapContext and the given
        /// record writer
        /// </summary>
        private Reducer.Context CreateReduceContext <Keyin, Valuein, Keyout, Valueout>(RecordWriter
                                                                                       <KEYOUT, VALUEOUT> rw, ReduceContext <KEYIN, VALUEIN, KEYOUT, VALUEOUT> context,
                                                                                       Configuration conf)
        {
            ReduceContext <KEYIN, VALUEIN, KEYOUT, VALUEOUT> reduceContext = new ChainReduceContextImpl
                                                                             <KEYIN, VALUEIN, KEYOUT, VALUEOUT>(context, rw, conf);

            Reducer.Context reducerContext = new WrappedReducer <KEYIN, VALUEIN, KEYOUT, VALUEOUT
                                                                 >().GetReducerContext(reduceContext);
            return(reducerContext);
        }
示例#11
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.WriteReference(Faction, FormKindSet.FactOnly);
     writer.Write(Rank);
     writer.Write(Unused);
 }
示例#12
0
 /// <exception cref="System.IO.IOException"/>
 /// <exception cref="System.Exception"/>
 internal ReduceRunner(Chain _enclosing, Reducer.Context context, Reducer <KEYIN, VALUEIN
                                                                           , KEYOUT, VALUEOUT> reducer, RecordWriter <KEYOUT, VALUEOUT> rw)
 {
     this._enclosing   = _enclosing;
     this.reducer      = reducer;
     this.chainContext = context;
     this.rw           = rw;
 }
示例#13
0
        /// <summary>
        /// Create a map context that is based on ChainMapContext and the given record
        /// reader and record writer
        /// </summary>
        private Mapper.Context CreateMapContext <Keyin, Valuein, Keyout, Valueout>(RecordReader
                                                                                   <KEYIN, VALUEIN> rr, RecordWriter <KEYOUT, VALUEOUT> rw, TaskInputOutputContext <KEYIN
                                                                                                                                                                    , VALUEIN, KEYOUT, VALUEOUT> context, Configuration conf)
        {
            MapContext <KEYIN, VALUEIN, KEYOUT, VALUEOUT> mapContext = new ChainMapContextImpl
                                                                       <KEYIN, VALUEIN, KEYOUT, VALUEOUT>(context, rr, rw, conf);

            Mapper.Context mapperContext = new WrappedMapper <KEYIN, VALUEIN, KEYOUT, VALUEOUT
                                                              >().GetMapContext(mapContext);
            return(mapperContext);
        }
示例#14
0
 /// <exception cref="System.IO.IOException"/>
 /// <exception cref="System.Exception"/>
 public MapRunner(Chain _enclosing, Mapper <KEYIN, VALUEIN, KEYOUT, VALUEOUT> mapper
                  , Mapper.Context mapperContext, RecordReader <KEYIN, VALUEIN> rr, RecordWriter <KEYOUT
                                                                                                  , VALUEOUT> rw)
 {
     this._enclosing   = _enclosing;
     this.mapper       = mapper;
     this.rr           = rr;
     this.rw           = rw;
     this.chainContext = mapperContext;
 }
        /// <exception cref="System.IO.IOException"/>
        public virtual void TestFailAbort()
        {
            JobConf job = new JobConf();

            job.Set(FileSystem.FsDefaultNameKey, "faildel:///");
            job.SetClass("fs.faildel.impl", typeof(TestMRCJCFileOutputCommitter.FakeFileSystem
                                                   ), typeof(FileSystem));
            SetConfForFileOutputCommitter(job);
            JobContext          jContext  = new JobContextImpl(job, ((JobID)taskID.GetJobID()));
            TaskAttemptContext  tContext  = new TaskAttemptContextImpl(job, taskID);
            FileOutputCommitter committer = new FileOutputCommitter();

            FileOutputFormat.SetWorkOutputPath(job, committer.GetTaskAttemptPath(tContext));
            // do setup
            committer.SetupJob(jContext);
            committer.SetupTask(tContext);
            string   file      = "test.txt";
            FilePath jobTmpDir = new FilePath(committer.GetJobAttemptPath(jContext).ToUri().GetPath
                                                  ());
            FilePath taskTmpDir = new FilePath(committer.GetTaskAttemptPath(tContext).ToUri()
                                               .GetPath());
            FilePath expectedFile = new FilePath(taskTmpDir, file);
            // A reporter that does nothing
            Reporter reporter = Reporter.Null;
            // write output
            FileSystem       localFs         = new TestMRCJCFileOutputCommitter.FakeFileSystem();
            TextOutputFormat theOutputFormat = new TextOutputFormat();
            RecordWriter     theRecordWriter = theOutputFormat.GetRecordWriter(localFs, job, expectedFile
                                                                               .GetAbsolutePath(), reporter);

            WriteOutput(theRecordWriter, reporter);
            // do abort
            Exception th = null;

            try
            {
                committer.AbortTask(tContext);
            }
            catch (IOException ie)
            {
                th = ie;
            }
            NUnit.Framework.Assert.IsNotNull(th);
            NUnit.Framework.Assert.IsTrue(th is IOException);
            NUnit.Framework.Assert.IsTrue(th.Message.Contains("fake delete failed"));
            NUnit.Framework.Assert.IsTrue(expectedFile + " does not exists", expectedFile.Exists
                                              ());
            th = null;
            try
            {
                committer.AbortJob(jContext, JobStatus.State.Failed);
            }
            catch (IOException ie)
            {
                th = ie;
            }
            NUnit.Framework.Assert.IsNotNull(th);
            NUnit.Framework.Assert.IsTrue(th is IOException);
            NUnit.Framework.Assert.IsTrue(th.Message.Contains("fake delete failed"));
            NUnit.Framework.Assert.IsTrue("job temp dir does not exists", jobTmpDir.Exists());
        }
示例#16
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Version);
     writer.Write(NumRecords);
     writer.Write(NextFormId);
 }
示例#17
0
 public FilterRecordWriter()
 {
     rawWriter = null;
 }
示例#18
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.WriteReference(Perk, FormKindSet.PerkOnly);
     writer.Write(Rank);
     writer.Write(Unused);
 }
示例#19
0
 protected override void BeforeWrite(RecordWriter writer)
 {
     // Sync material count before saving
     MaterialCount = (uint)Materials.Count;
 }
示例#20
0
 internal override void WriteField(RecordWriter writer)
 {
     throw new NotImplementedException();
 }
示例#21
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Magnitude);
     writer.Write(Area);
     writer.Write(Duration);
 }
示例#22
0
        protected override void BeforeWrite(RecordWriter writer)
        {
            // Sent ench ammount to null if no enchantment assigned
            if (Enchantment == 0)
                EnchantmentAmount = null;

            // Ensure enchantment amount is set (at least zero) if enchantment is assigned
            else if (EnchantmentAmount == null)
                EnchantmentAmount = 0;
        }
示例#23
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Value);
     writer.Write(Weight);
 }
示例#24
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Damage);
     writer.Write(Unknown);
     writer.Write(Multiplier);
     writer.Write((uint)Flags);
     writer.WriteReference(SpellEffect, FormKindSet.SpelOnly);
 }
示例#25
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Saturation);
     writer.Write(Brightness);
     writer.Write(Contrast);
 }
示例#26
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write((uint)WeaponType & 0xFF);
     writer.Write(Speed);
     writer.Write(Reach);
     writer.Write((ushort)Flags);
     writer.Write(Unknown1);
     writer.Write(SightFov);
     writer.Write(Unknown2);
     writer.Write(VatsToHitChance);
     writer.Write((byte)AttackAnimation);
     writer.Write(Projectiles);
     writer.Write(EmbeddedWeapon);
     writer.Write(MinRange);
     writer.Write(MaxRange);
     writer.Write((uint)OnHitBehavior);
     writer.Write((uint)Flags2);
     writer.Write(AttackAnimationMultiplier);
     writer.Write(Unknown3);
     writer.Write(RumbleLeftMotorStrength);
     writer.Write(RumbleRightMotosStrength);
     writer.Write(RumbleDuration);
     writer.Write(Unknown4);
     writer.Write(Unknown5);
     writer.Write(Unknown6);
     writer.Write((int)Skill);
     writer.Write(Unknown7);
     writer.Write(Unknown8);
     writer.Write((int)Resist);
     writer.Write(Unknown9);
     writer.Write(Stagger);
 }
示例#27
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.WriteReference(Projectile, FormKindSet.ProjOnly);
     writer.Write((uint)Flags);
     writer.Write(Damage);
     writer.Write(Value);
 }
示例#28
0
        public void RunReduce(int reduce, bool pipedOutput)
        {
            reducer = factory.CreateReducer(this);
            writer = factory.CreateRecordWriter(this);

            hasTask = true;
        }
示例#29
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Value);
     writer.Write((uint)Flags);
     writer.WriteReference(Addiction, FormKindSet.Any);
     writer.Write(AddictionChance);
     writer.WriteReference(ConsumeSound, FormKindSet.SndrOnly);
 }
示例#30
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Bytes);
 }
示例#31
0
 public override void BeginInvoke(SpoolSpace Memory)
 {
     this._Path   = Memory[this._LibName][this._VarName];
     this._Writer = this._Host.OpenTable(this._Path).OpenWriter();
     this._Select = new ExpressionCollection(this._Parameters[0] as Expression.ArrayLiteral);
 }
示例#32
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Saturation);
     writer.Write(Brightness);
     writer.Write(Contrast);
 }
示例#33
0
            internal override void WriteField(RecordWriter writer)
            {
                writer.Write((byte)Flags);
                writer.Write((byte)0);
                writer.Write((short)0);

                if (Flags.HasFlag(ConditionFlags.UseGlobal))
                    writer.WriteReference(Operand.GlobalVariable, FormKindSet.GlobOnly);
                else
                    writer.Write(Operand.FloatValue);

                writer.Write((ushort)Function);
                writer.Write((short)0);

                // Find function signature
                var signature = SignatureProvider.Default.GetSignature(Function);

                // Read function params
                // References must be read with ReadReference function
                if (signature[0].IsReference)
                    writer.WriteReference(Params.UInt32_0, signature[0].Reference);
                else
                    writer.Write(Params.Int32_0);

                if (signature[1].IsReference)
                    writer.WriteReference(Params.UInt32_1, signature[1].Reference);
                else
                    writer.Write(Params.Int32_1);

                writer.Write((uint)Target);
                if (Target == FunctionTarget.Subject || Target == FunctionTarget.Subject || Target == FunctionTarget.CombatTarget)
                    writer.Write((uint)0);
                else
                    writer.WriteReference(TargetReference, FormKindSet.Any);

                // Third parameter
                writer.Write(IntParam3);
            }
示例#34
0
 public _OutputCollector_419(RecordWriter <OUTKEY, OUTVALUE> finalOut, Task.TaskReporter
                             reporter)
 {
     this.finalOut = finalOut;
     this.reporter = reporter;
 }
示例#35
0
 internal ChainMapContextImpl(TaskInputOutputContext <KEYIN, VALUEIN, KEYOUT, VALUEOUT
                                                      > @base, RecordReader <KEYIN, VALUEIN> rr, RecordWriter <KEYOUT, VALUEOUT> rw, Configuration
                              conf)
 {
     this.reader = rr;
     this.output = rw;
     this.@base  = @base;
     this.conf   = conf;
 }
示例#36
0
        public virtual void TestCompress()
        {
            JobConf job = new JobConf();

            job.Set(JobContext.TaskAttemptId, attempt);
            job.Set(FileOutputFormat.Compress, "true");
            FileOutputFormat.SetOutputPath(job, workDir.GetParent().GetParent());
            FileOutputFormat.SetWorkOutputPath(job, workDir);
            FileSystem fs = workDir.GetFileSystem(job);

            if (!fs.Mkdirs(workDir))
            {
                NUnit.Framework.Assert.Fail("Failed to create output directory");
            }
            string file = "test_compress.txt";
            // A reporter that does nothing
            Reporter reporter = Reporter.Null;
            TextOutputFormat <object, object> theOutputFormat = new TextOutputFormat <object, object
                                                                                      >();
            RecordWriter <object, object> theRecordWriter = theOutputFormat.GetRecordWriter(localFs
                                                                                            , job, file, reporter);

            Org.Apache.Hadoop.IO.Text key1 = new Org.Apache.Hadoop.IO.Text("key1");
            Org.Apache.Hadoop.IO.Text key2 = new Org.Apache.Hadoop.IO.Text("key2");
            Org.Apache.Hadoop.IO.Text val1 = new Org.Apache.Hadoop.IO.Text("val1");
            Org.Apache.Hadoop.IO.Text val2 = new Org.Apache.Hadoop.IO.Text("val2");
            NullWritable nullWritable      = NullWritable.Get();

            try
            {
                theRecordWriter.Write(key1, val1);
                theRecordWriter.Write(null, nullWritable);
                theRecordWriter.Write(null, val1);
                theRecordWriter.Write(nullWritable, val2);
                theRecordWriter.Write(key2, nullWritable);
                theRecordWriter.Write(key1, null);
                theRecordWriter.Write(null, null);
                theRecordWriter.Write(key2, val2);
            }
            finally
            {
                theRecordWriter.Close(reporter);
            }
            StringBuilder expectedOutput = new StringBuilder();

            expectedOutput.Append(key1).Append("\t").Append(val1).Append("\n");
            expectedOutput.Append(val1).Append("\n");
            expectedOutput.Append(val2).Append("\n");
            expectedOutput.Append(key2).Append("\n");
            expectedOutput.Append(key1).Append("\n");
            expectedOutput.Append(key2).Append("\t").Append(val2).Append("\n");
            DefaultCodec codec = new DefaultCodec();

            codec.SetConf(job);
            Path                   expectedFile = new Path(workDir, file + codec.GetDefaultExtension());
            FileInputStream        istream      = new FileInputStream(expectedFile.ToString());
            CompressionInputStream cistream     = codec.CreateInputStream(istream);
            LineReader             reader       = new LineReader(cistream);
            string                 output       = string.Empty;

            Org.Apache.Hadoop.IO.Text @out = new Org.Apache.Hadoop.IO.Text();
            while (reader.ReadLine(@out) > 0)
            {
                output += @out;
                output += "\n";
            }
            reader.Close();
            NUnit.Framework.Assert.AreEqual(expectedOutput.ToString(), output);
        }
示例#37
0
 public FilterRecordWriter(RecordWriter <K, V> rwriter)
 {
     this.rawWriter = rwriter;
 }
示例#38
0
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="System.Exception"/>
        public virtual void TestFailAbort()
        {
            Job           job  = Job.GetInstance();
            Configuration conf = job.GetConfiguration();

            conf.Set(FileSystem.FsDefaultNameKey, "faildel:///");
            conf.SetClass("fs.faildel.impl", typeof(TestMRCJCFileOutputCommitter.FakeFileSystem
                                                    ), typeof(FileSystem));
            conf.Set(MRJobConfig.TaskAttemptId, attempt);
            FileOutputFormat.SetOutputPath(job, outDir);
            JobContext          jContext  = new JobContextImpl(conf, taskID.GetJobID());
            TaskAttemptContext  tContext  = new TaskAttemptContextImpl(conf, taskID);
            FileOutputCommitter committer = new FileOutputCommitter(outDir, tContext);

            // do setup
            committer.SetupJob(jContext);
            committer.SetupTask(tContext);
            // write output
            TextOutputFormat <object, object> theOutputFormat = new TextOutputFormat();
            RecordWriter <object, object>     theRecordWriter = theOutputFormat.GetRecordWriter(tContext
                                                                                                );

            WriteOutput(theRecordWriter, tContext);
            // do abort
            Exception th = null;

            try
            {
                committer.AbortTask(tContext);
            }
            catch (IOException ie)
            {
                th = ie;
            }
            NUnit.Framework.Assert.IsNotNull(th);
            NUnit.Framework.Assert.IsTrue(th is IOException);
            NUnit.Framework.Assert.IsTrue(th.Message.Contains("fake delete failed"));
            //Path taskBaseDirName = committer.getTaskAttemptBaseDirName(tContext);
            FilePath jobTmpDir = new FilePath(committer.GetJobAttemptPath(jContext).ToUri().GetPath
                                                  ());
            FilePath taskTmpDir = new FilePath(committer.GetTaskAttemptPath(tContext).ToUri()
                                               .GetPath());
            FilePath expectedFile = new FilePath(taskTmpDir, partFile);

            NUnit.Framework.Assert.IsTrue(expectedFile + " does not exists", expectedFile.Exists
                                              ());
            th = null;
            try
            {
                committer.AbortJob(jContext, JobStatus.State.Failed);
            }
            catch (IOException ie)
            {
                th = ie;
            }
            NUnit.Framework.Assert.IsNotNull(th);
            NUnit.Framework.Assert.IsTrue(th is IOException);
            NUnit.Framework.Assert.IsTrue(th.Message.Contains("fake delete failed"));
            NUnit.Framework.Assert.IsTrue("job temp dir does not exists", jobTmpDir.Exists());
            FileUtil.FullyDelete(new FilePath(outDir.ToString()));
        }
示例#39
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.WriteReference(Item, FormKindSet.Any);
     writer.Write(Quantity);
 }
示例#40
0
 public override void BeginInvoke(SpoolSpace Memory)
 {
     this._Writer = this._Output.OpenWriter();
 }
示例#41
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Magnitude);
     writer.Write(Area);
     writer.Write(Duration);
 }
示例#42
0
            internal override void WriteField(RecordWriter writer)
            {
                writer.Write((ushort)Flags);
                writer.Write((ushort)Type);
                writer.Write(Gravity);
                writer.Write(Speed);
                writer.Write(Range);
                writer.WriteReference(Light, FormKindSet.Any);
                writer.WriteReference(MuzzleFlashLight, FormKindSet.Any);
                writer.Write(TracerChance);
                writer.Write(AltExplosionTriggerProximity);
                writer.Write(AltExplosionTriggerTimer);
                writer.WriteReference(Explosion, FormKindSet.Any);
                writer.WriteReference(Sound, FormKindSet.Any);
                writer.Write(MuzzleFlashDuration);
                writer.Write(FadeDuration);
                writer.Write(ImpactForce);
                writer.WriteReference(CountdownSound, FormKindSet.Any);
                writer.WriteReference(DisableSound, FormKindSet.Any);
                writer.WriteReference(DefaultWeaponSource, FormKindSet.Any);
                writer.Write(ConeSpread);
                writer.Write(CollisionRadius);
                writer.Write(Lifetime);
                writer.Write(RelaunchInterval);

                // Write this field only if it was loaded, or if value is assigned to it
                // Or the next optional value is assigned
                if (!decalDataNotLoaded || DecalData != 0 || CollisionLayer != 0)
                    writer.WriteReference(DecalData, FormKindSet.Any);

                // Write this field only if it was loaded, or if value is assigned to it
                if (!collisionLayerNotLoaded || CollisionLayer != 0)
                    writer.WriteReference(CollisionLayer, FormKindSet.Any);
            }
示例#43
0
 public MapContextImpl(Configuration conf, TaskAttemptID taskid, RecordReader <KEYIN
                                                                               , VALUEIN> reader, RecordWriter <KEYOUT, VALUEOUT> writer, OutputCommitter committer
                       , StatusReporter reporter, InputSplit split)
     : base(conf, taskid, writer, committer, reporter)
 {
     this.reader = reader;
     this.split  = split;
 }
示例#44
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.WriteReference(Item, FormKindSet.Any);
     writer.Write(Quantity);
 }
示例#45
0
 protected override void BeforeWrite(RecordWriter writer)
 {
     // Ensure either Usage or Usage2 exists before saving record
     EnsureEitherUsageExists();
 }
示例#46
0
 protected override void BeforeWrite(RecordWriter writer)
 {
     // Sync material count before saving
     MaterialCount = (uint)Materials.Count;
 }
示例#47
0
            internal override void WriteField(RecordWriter writer)
            {
                writer.Write((uint)BodyParts);
                writer.Write((uint)Flags);

                // Write skill usage too although it is optional
                writer.Write((uint)SkillUsage);
            }
示例#48
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Value);
     writer.Write(Weight);
     writer.Write(Damage);
 }
示例#49
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(X1);
     writer.Write(Y1);
     writer.Write(Z1);
     writer.Write(X2);
     writer.Write(Y2);
     writer.Write(Z2);
 }
示例#50
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Bytes);
 }
示例#51
0
            internal override void WriteField(RecordWriter writer)
            {
                writer.Write(Strength);
                writer.Write(Distance);
                writer.Write(Range);

                if (Radius != 0)
                {
                    // Write radius only if initialized
                    writer.Write(Radius);
                }
            }
示例#52
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write((uint)Flags);
     writer.Write(Duration);
     for (int i = 0; i < Sizes1.Length; i++)
         writer.Write(Sizes1[i]);
     writer.Write((uint)BlurFlags);
     writer.Write(BlurCenterX);
     writer.Write(BlurCenterY);
     for (int i = 0; i < Sizes2.Length; i++)
         writer.Write(Sizes2[i]);
     writer.Write((uint)DepthOfFieldFlags);
     for (int i = 0; i < Sizes3.Length; i++)
         writer.Write(Sizes3[i]);
     if (Sizes4 != null)
         for (int i = 0; i < Sizes4.Length; i++)
             writer.Write(Sizes4[i]);
 }
示例#53
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.Write(Amount);
     writer.Write(Red);
     writer.Write(Green);
     writer.Write(Blue);
 }
示例#54
0
 internal override void WriteField(RecordWriter writer)
 {
     // Save mult and add fields interleaved
     // WriteField will ensure null elements are not written
     for (int i = 0; i < 64; i++)
     {
         string multFieldName = (char)i + "IAD";
         writer.WriteField(elements[i], multFieldName);
         string addFieldName = (char)(i + 64) + "IAD";
         writer.WriteField(elements[i + 64], addFieldName);
     }
 }
示例#55
0
 protected override void AfterWrite(RecordWriter writer)
 {
     if (Data == null)
         Data = new KeywordData();
 }
        private RecordWriter GetWriterToTest()
        {
            var writer = new RecordWriter();

            writer.AddAnalogChannel(new AnalogChannelInformation("channel1a", "A"));
            writer.AddAnalogChannel(new AnalogChannelInformation("channel2a", "B"));
            writer.AddAnalogChannel(new AnalogChannelInformation("channel3a", "C"));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel1b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel2b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel3b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel4b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel5b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel6b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel7b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel8b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel9b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel10b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel11b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel12b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel13b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel14b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel15b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel16b", ""));
            writer.AddDigitalChannel(new DigitalChannelInformation("channel17b", ""));
            writer.AddSample(0,
                             new double[] { 0, 0, 0 },
                             new[] {
                true, true, true, true,
                true, true, true, true,
                true, true, true, true,
                true, true, true, true,
                true
            });
            writer.AddSample(500,
                             new[] { 1.0, 2.0, 3.0 },
                             new[] {
                false, false, false, false,
                false, false, false, false,
                false, false, false, false,
                false, false, false, false,
                false
            });
            writer.AddSample(1000,
                             new[] { -1.0, 2.0, -3.5 },
                             new[] {
                false, false, false, false,
                true, true, true, true,
                false, true, false, true,
                true, false, true, false,
                true
            });

            writer.AddSample(1500,
                             new[] { 5.0, 5.0, 5.0 },
                             new[] {
                false, false, false, false,
                true, true, true, true,
                false, true, false, true,
                true, false, true, false,
                true
            });

            writer.StartTime   = new DateTime(1234567890);
            writer.TriggerTime = new DateTime(1234569000);
            return(writer);
        }
示例#57
0
 internal override void WriteField(RecordWriter writer)
 {
     writer.WriteReference(Sound, FormKindSet.SndrOnly);
     writer.Write((int)Type);
 }
示例#58
0
 public _OutputCollector_511(RecordWriter writer)
 {
     this.writer = writer;
 }