Lucene.Net.TestFramework.MockFixedIntBlockPostingsFormat: Renamed MockFixedInt32BlockPostingsFormat
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/b483fa78 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/b483fa78 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/b483fa78 Branch: refs/heads/api-work Commit: b483fa7896328583af31bc12d0fb05989775850f Parents: 1c137de Author: Shad Storhaug <[email protected]> Authored: Sun Mar 19 22:35:11 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Sun Mar 19 22:41:11 2017 +0700 ---------------------------------------------------------------------- .../MockFixedIntBlockPostingsFormat.cs | 36 ++++++++++---------- .../MockRandom/MockRandomPostingsFormat.cs | 2 +- .../Index/RandomCodec.cs | 4 +-- .../IntBlock/TestFixedIntBlockPostingsFormat.cs | 2 +- .../IntBlock/TestIntBlockCodec.cs | 4 +-- 5 files changed, 24 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b483fa78/src/Lucene.Net.TestFramework/Codecs/MockIntBlock/MockFixedIntBlockPostingsFormat.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Codecs/MockIntBlock/MockFixedIntBlockPostingsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/MockIntBlock/MockFixedIntBlockPostingsFormat.cs index 31e8731..6d83470 100644 --- a/src/Lucene.Net.TestFramework/Codecs/MockIntBlock/MockFixedIntBlockPostingsFormat.cs +++ b/src/Lucene.Net.TestFramework/Codecs/MockIntBlock/MockFixedIntBlockPostingsFormat.cs @@ -30,16 +30,16 @@ namespace Lucene.Net.Codecs.MockIntBlock /// used here just writes each block as a series of vInt. /// </summary> [PostingsFormatName("MockFixedIntBlock")] // LUCENENET specific - using PostingsFormatName attribute to ensure the default name passed from subclasses is the same as this class name - public sealed class MockFixedIntBlockPostingsFormat : PostingsFormat + public sealed class MockFixedInt32BlockPostingsFormat : PostingsFormat { private readonly int blockSize; - public MockFixedIntBlockPostingsFormat() + public MockFixedInt32BlockPostingsFormat() : this(1) { } - public MockFixedIntBlockPostingsFormat(int blockSize) + public MockFixedInt32BlockPostingsFormat(int blockSize) : base() { this.blockSize = blockSize; @@ -51,33 +51,33 @@ namespace Lucene.Net.Codecs.MockIntBlock } // only for testing - public Int32StreamFactory getIntFactory() + public Int32StreamFactory GetInt32Factory() { - return new MockIntFactory(blockSize); + return new MockInt32Factory(blockSize); } /** * Encodes blocks as vInts of a fixed block size. */ - public class MockIntFactory : Int32StreamFactory + public class MockInt32Factory : Int32StreamFactory { private readonly int blockSize; - public MockIntFactory(int blockSize) + public MockInt32Factory(int blockSize) { this.blockSize = blockSize; } public override Int32IndexInput OpenInput(Directory dir, string fileName, IOContext context) { - return new FixedIntBlockIndexInputAnonymousHelper(this, dir.OpenInput(fileName, context)); + return new FixedInt32BlockIndexInputAnonymousHelper(this, dir.OpenInput(fileName, context)); } - private class FixedIntBlockIndexInputAnonymousHelper : FixedInt32BlockIndexInput + private class FixedInt32BlockIndexInputAnonymousHelper : FixedInt32BlockIndexInput { - private readonly MockIntFactory outerInstance; + private readonly MockInt32Factory outerInstance; - public FixedIntBlockIndexInputAnonymousHelper(MockIntFactory outerInstance, IndexInput input) + public FixedInt32BlockIndexInputAnonymousHelper(MockInt32Factory outerInstance, IndexInput input) : base(input) { this.outerInstance = outerInstance; @@ -90,11 +90,11 @@ namespace Lucene.Net.Codecs.MockIntBlock private class BlockReaderAnonymousHelper : FixedInt32BlockIndexInput.IBlockReader { - private readonly MockIntFactory outerInstance; + private readonly MockInt32Factory outerInstance; private readonly IndexInput @in; private readonly int[] buffer; - public BlockReaderAnonymousHelper(MockIntFactory outerInstance, IndexInput @in, int[] buffer) + public BlockReaderAnonymousHelper(MockInt32Factory outerInstance, IndexInput @in, int[] buffer) { this.outerInstance = outerInstance; this.@in = @in; @@ -121,7 +121,7 @@ namespace Lucene.Net.Codecs.MockIntBlock bool success = false; try { - FixedIntBlockIndexOutputAnonymousHelper ret = new FixedIntBlockIndexOutputAnonymousHelper(output, blockSize); + FixedInt32BlockIndexOutputAnonymousHelper ret = new FixedInt32BlockIndexOutputAnonymousHelper(output, blockSize); success = true; return ret; @@ -136,9 +136,9 @@ namespace Lucene.Net.Codecs.MockIntBlock } } - private class FixedIntBlockIndexOutputAnonymousHelper : FixedInt32BlockIndexOutput + private class FixedInt32BlockIndexOutputAnonymousHelper : FixedInt32BlockIndexOutput { - public FixedIntBlockIndexOutputAnonymousHelper(IndexOutput output, int blockSize) + public FixedInt32BlockIndexOutputAnonymousHelper(IndexOutput output, int blockSize) : base(output, blockSize) { } @@ -153,7 +153,7 @@ namespace Lucene.Net.Codecs.MockIntBlock public override FieldsConsumer FieldsConsumer(SegmentWriteState state) { - PostingsWriterBase postingsWriter = new SepPostingsWriter(state, new MockIntFactory(blockSize)); + PostingsWriterBase postingsWriter = new SepPostingsWriter(state, new MockInt32Factory(blockSize)); bool success = false; TermsIndexWriterBase indexWriter; @@ -199,7 +199,7 @@ namespace Lucene.Net.Codecs.MockIntBlock state.FieldInfos, state.SegmentInfo, state.Context, - new MockIntFactory(blockSize), state.SegmentSuffix); + new MockInt32Factory(blockSize), state.SegmentSuffix); TermsIndexReaderBase indexReader; bool success = false; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b483fa78/src/Lucene.Net.TestFramework/Codecs/MockRandom/MockRandomPostingsFormat.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Codecs/MockRandom/MockRandomPostingsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/MockRandom/MockRandomPostingsFormat.cs index 069bd38..d6cef25 100644 --- a/src/Lucene.Net.TestFramework/Codecs/MockRandom/MockRandomPostingsFormat.cs +++ b/src/Lucene.Net.TestFramework/Codecs/MockRandom/MockRandomPostingsFormat.cs @@ -73,7 +73,7 @@ namespace Lucene.Net.Codecs.MockRandom salt = random.nextInt(); delegates.Add(new MockSingleIntFactory()); int blockSize = TestUtil.NextInt(random, 1, 2000); - delegates.Add(new MockFixedIntBlockPostingsFormat.MockIntFactory(blockSize)); + delegates.Add(new MockFixedInt32BlockPostingsFormat.MockInt32Factory(blockSize)); int baseBlockSize = TestUtil.NextInt(random, 1, 127); delegates.Add(new MockVariableInt32BlockPostingsFormat.MockInt32Factory(baseBlockSize)); // TODO: others http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b483fa78/src/Lucene.Net.TestFramework/Index/RandomCodec.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Index/RandomCodec.cs b/src/Lucene.Net.TestFramework/Index/RandomCodec.cs index 2bb83be..d223733 100644 --- a/src/Lucene.Net.TestFramework/Index/RandomCodec.cs +++ b/src/Lucene.Net.TestFramework/Index/RandomCodec.cs @@ -42,7 +42,7 @@ namespace Lucene.Net.Index using DirectPostingsFormat = Lucene.Net.Codecs.Memory.DirectPostingsFormat; using MemoryDocValuesFormat = Lucene.Net.Codecs.Memory.MemoryDocValuesFormat; using MemoryPostingsFormat = Lucene.Net.Codecs.Memory.MemoryPostingsFormat; - using MockFixedIntBlockPostingsFormat = Lucene.Net.Codecs.MockIntBlock.MockFixedIntBlockPostingsFormat; + using MockFixedInt32BlockPostingsFormat = Lucene.Net.Codecs.MockIntBlock.MockFixedInt32BlockPostingsFormat; using MockVariableInt32BlockPostingsFormat = Lucene.Net.Codecs.MockIntBlock.MockVariableInt32BlockPostingsFormat; using MockRandomPostingsFormat = Lucene.Net.Codecs.MockRandom.MockRandomPostingsFormat; using MockSepPostingsFormat = Lucene.Net.Codecs.MockSep.MockSepPostingsFormat; @@ -166,7 +166,7 @@ namespace Lucene.Net.Index //with such "wrapper" classes? new TestBloomFilteredLucene41Postings(), new MockSepPostingsFormat(), - new MockFixedIntBlockPostingsFormat(TestUtil.NextInt(random, 1, 2000)), + new MockFixedInt32BlockPostingsFormat(TestUtil.NextInt(random, 1, 2000)), new MockVariableInt32BlockPostingsFormat(TestUtil.NextInt(random, 1, 127)), new MockRandomPostingsFormat(random), new NestedPulsingPostingsFormat(), http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b483fa78/src/Lucene.Net.Tests.Codecs/IntBlock/TestFixedIntBlockPostingsFormat.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Codecs/IntBlock/TestFixedIntBlockPostingsFormat.cs b/src/Lucene.Net.Tests.Codecs/IntBlock/TestFixedIntBlockPostingsFormat.cs index 4aa7219..df31627 100644 --- a/src/Lucene.Net.Tests.Codecs/IntBlock/TestFixedIntBlockPostingsFormat.cs +++ b/src/Lucene.Net.Tests.Codecs/IntBlock/TestFixedIntBlockPostingsFormat.cs @@ -28,7 +28,7 @@ namespace Lucene.Net.Codecs.IntBlock public class TestFixedIntBlockPostingsFormat : BasePostingsFormatTestCase { // TODO: randomize blocksize - private readonly Codec codec = TestUtil.AlwaysPostingsFormat(new MockFixedIntBlockPostingsFormat()); + private readonly Codec codec = TestUtil.AlwaysPostingsFormat(new MockFixedInt32BlockPostingsFormat()); protected override Codec Codec { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b483fa78/src/Lucene.Net.Tests.Codecs/IntBlock/TestIntBlockCodec.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Codecs/IntBlock/TestIntBlockCodec.cs b/src/Lucene.Net.Tests.Codecs/IntBlock/TestIntBlockCodec.cs index 6429ae1..b7f6134 100644 --- a/src/Lucene.Net.Tests.Codecs/IntBlock/TestIntBlockCodec.cs +++ b/src/Lucene.Net.Tests.Codecs/IntBlock/TestIntBlockCodec.cs @@ -31,7 +31,7 @@ namespace Lucene.Net.Codecs.IntBlock { Directory dir = NewDirectory(); - Int32StreamFactory f = (new MockFixedIntBlockPostingsFormat(128)).getIntFactory(); + Int32StreamFactory f = (new MockFixedInt32BlockPostingsFormat(128)).GetInt32Factory(); Int32IndexOutput @out = f.CreateOutput(dir, "test", NewIOContext(Random())); for (int i = 0; i < 11777; i++) @@ -57,7 +57,7 @@ namespace Lucene.Net.Codecs.IntBlock { Directory dir = NewDirectory(); - Int32StreamFactory f = (new MockFixedIntBlockPostingsFormat(128)).getIntFactory(); + Int32StreamFactory f = (new MockFixedInt32BlockPostingsFormat(128)).GetInt32Factory(); Int32IndexOutput @out = f.CreateOutput(dir, "test", NewIOContext(Random())); // write no ints
