lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [1/2] lucenenet git commit: Renaming enum
Date Tue, 10 Feb 2015 23:29:29 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 5a8c736fd -> 51eb5d7a3


Renaming enum


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/5e17a27a
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/5e17a27a
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/5e17a27a

Branch: refs/heads/master
Commit: 5e17a27a61bb93e010efa11722bd1f626c32e04a
Parents: 5a8c736
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Wed Feb 11 01:29:04 2015 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Wed Feb 11 01:29:04 2015 +0200

----------------------------------------------------------------------
 .../Memory/DirectPostingsFormat.cs              |  2 +-
 src/Lucene.Net.Core/Store/BufferedIndexInput.cs |  2 +-
 src/Lucene.Net.Core/Store/IOContext.cs          | 30 ++++++++++----------
 .../Store/RateLimitedDirectoryWrapper.cs        | 10 +++----
 .../Util/LuceneTestCase.cs                      |  8 +++---
 5 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5e17a27a/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs b/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
index dc36b6b..378399d 100644
--- a/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
+++ b/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
@@ -110,7 +110,7 @@ namespace Lucene.Net.Codecs.Memory
         public override FieldsProducer FieldsProducer(SegmentReadState state)
         {
             var postings = ForName("Lucene41").FieldsProducer(state);
-            if (state.Context.Context != IOContext.Context_e.MERGE)
+            if (state.Context.Context != IOContext.UsageContext.MERGE)
             {
                 FieldsProducer loadedPostings;
                 try

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5e17a27a/src/Lucene.Net.Core/Store/BufferedIndexInput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/BufferedIndexInput.cs b/src/Lucene.Net.Core/Store/BufferedIndexInput.cs
index 31b9d23..df3845e 100644
--- a/src/Lucene.Net.Core/Store/BufferedIndexInput.cs
+++ b/src/Lucene.Net.Core/Store/BufferedIndexInput.cs
@@ -450,7 +450,7 @@ namespace Lucene.Net.Store
         {
             switch (context.Context)
             {
-                case IOContext.Context_e.MERGE:
+                case IOContext.UsageContext.MERGE:
                     return MERGE_BUFFER_SIZE;
 
                 default:

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5e17a27a/src/Lucene.Net.Core/Store/IOContext.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/IOContext.cs b/src/Lucene.Net.Core/Store/IOContext.cs
index 3838899..ef564a5 100644
--- a/src/Lucene.Net.Core/Store/IOContext.cs
+++ b/src/Lucene.Net.Core/Store/IOContext.cs
@@ -32,7 +32,7 @@ namespace Lucene.Net.Store
         /// Context is a enumerator which specifies the context in which the Directory
         /// is being used for.
         /// </summary>
-        public enum Context_e
+        public enum UsageContext
         {
             MERGE,
             READ,
@@ -43,7 +43,7 @@ namespace Lucene.Net.Store
         /// <summary>
         /// An object of a enumerator Context type
         /// </summary>
-        public readonly Context_e? Context;
+        public readonly UsageContext? Context;
 
         public readonly MergeInfo MergeInfo;
 
@@ -51,7 +51,7 @@ namespace Lucene.Net.Store
 
         public readonly bool ReadOnce;
 
-        public static readonly IOContext DEFAULT = new IOContext(Context_e.DEFAULT);
+        public static readonly IOContext DEFAULT = new IOContext(UsageContext.DEFAULT);
 
         public static readonly IOContext READONCE = new IOContext(true);
 
@@ -65,34 +65,34 @@ namespace Lucene.Net.Store
         public IOContext(FlushInfo flushInfo)
         {
             Debug.Assert(flushInfo != null);
-            this.Context = Context_e.FLUSH;
+            this.Context = UsageContext.FLUSH;
             this.MergeInfo = null;
             this.ReadOnce = false;
             this.FlushInfo = flushInfo;
         }
 
-        public IOContext(Context_e? context)
+        public IOContext(UsageContext? context)
             : this(context, null)
         {
         }
 
         private IOContext(bool readOnce)
         {
-            this.Context = Context_e.READ;
+            this.Context = UsageContext.READ;
             this.MergeInfo = null;
             this.ReadOnce = readOnce;
             this.FlushInfo = null;
         }
 
         public IOContext(MergeInfo mergeInfo)
-            : this(Context_e.MERGE, mergeInfo)
+            : this(UsageContext.MERGE, mergeInfo)
         {
         }
 
-        private IOContext(Context_e? context, MergeInfo mergeInfo)
+        private IOContext(UsageContext? context, MergeInfo mergeInfo)
         {
-            Debug.Assert(context != Context_e.MERGE || mergeInfo != null, "MergeInfo must
not be null if context is MERGE");
-            Debug.Assert(context != Context_e.FLUSH, "Use IOContext(FlushInfo) to create
a FLUSH IOContext");
+            Debug.Assert(context != UsageContext.MERGE || mergeInfo != null, "MergeInfo must
not be null if context is MERGE");
+            Debug.Assert(context != UsageContext.FLUSH, "Use IOContext(FlushInfo) to create
a FLUSH IOContext");
             this.Context = context;
             this.ReadOnce = false;
             this.MergeInfo = mergeInfo;
@@ -170,13 +170,13 @@ namespace Lucene.Net.Store
             return true;
         }
 
-        public static IEnumerable<Context_e> ContextValues()
+        public static IEnumerable<UsageContext> ContextValues()
         {
             // .NET port: This is to make up for enums in .NET not having a Values method.
-            yield return Context_e.DEFAULT;
-            yield return Context_e.FLUSH;
-            yield return Context_e.MERGE;
-            yield return Context_e.READ;
+            yield return UsageContext.DEFAULT;
+            yield return UsageContext.FLUSH;
+            yield return UsageContext.MERGE;
+            yield return UsageContext.READ;
         }
 
         public override string ToString()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5e17a27a/src/Lucene.Net.Core/Store/RateLimitedDirectoryWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/RateLimitedDirectoryWrapper.cs b/src/Lucene.Net.Core/Store/RateLimitedDirectoryWrapper.cs
index ba7d06d..5038e62 100644
--- a/src/Lucene.Net.Core/Store/RateLimitedDirectoryWrapper.cs
+++ b/src/Lucene.Net.Core/Store/RateLimitedDirectoryWrapper.cs
@@ -35,7 +35,7 @@ namespace Lucene.Net.Store
         // we need to be volatile here to make sure we see all the values that are set
         // / modified concurrently
         //private volatile RateLimiter[] ContextRateLimiters = new RateLimiter[Enum.GetValues(typeof(IOContext.Context_e)).Length];
-        private readonly IDictionary<IOContext.Context_e?, RateLimiter> _contextRateLimiters
= new ConcurrentDictionary<IOContext.Context_e?, RateLimiter>();
+        private readonly IDictionary<IOContext.UsageContext?, RateLimiter> _contextRateLimiters
= new ConcurrentDictionary<IOContext.UsageContext?, RateLimiter>();
 
         public RateLimitedDirectoryWrapper(Directory wrapped)
             : base(wrapped)
@@ -66,7 +66,7 @@ namespace Lucene.Net.Store
             @in.Copy(to, src, dest, context);
         }
 
-        private RateLimiter GetRateLimiter(IOContext.Context_e? context)
+        private RateLimiter GetRateLimiter(IOContext.UsageContext? context)
         {
             Debug.Assert(context != null);
             RateLimiter ret;
@@ -91,7 +91,7 @@ namespace Lucene.Net.Store
         ///           if context is <code>null</code> </exception>
         /// <exception cref="AlreadyClosedException"> if the <seealso cref="Directory"/>
is already closed
         /// @lucene.experimental </exception>
-        public void SetMaxWriteMBPerSec(double? mbPerSec, IOContext.Context_e? context)
+        public void SetMaxWriteMBPerSec(double? mbPerSec, IOContext.UsageContext? context)
         {
             EnsureOpen();
             if (context == null)
@@ -136,7 +136,7 @@ namespace Lucene.Net.Store
         ///           if context is <code>null</code> </exception>
         /// <exception cref="AlreadyClosedException"> if the <seealso cref="Directory"/>
is already closed
         /// @lucene.experimental </exception>
-        public void SetRateLimiter(RateLimiter mergeWriteRateLimiter, IOContext.Context_e
context)
+        public void SetRateLimiter(RateLimiter mergeWriteRateLimiter, IOContext.UsageContext
context)
         {
             EnsureOpen();
             _contextRateLimiters[context] = mergeWriteRateLimiter;
@@ -149,7 +149,7 @@ namespace Lucene.Net.Store
         ///           if context is <code>null</code> </exception>
         /// <exception cref="AlreadyClosedException"> if the <seealso cref="Directory"/>
is already closed
         /// @lucene.experimental </exception>
-        public double GetMaxWriteMBPerSec(IOContext.Context_e context)
+        public double GetMaxWriteMBPerSec(IOContext.UsageContext context)
         {
             EnsureOpen();
             var limiter = GetRateLimiter(context);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5e17a27a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index 2619d85..265e0be 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -1203,16 +1203,16 @@ namespace Lucene.Net.Util
                 switch (random.Next(10))
                 {
                     case 3: // sometimes rate limit on flush
-                        rateLimitedDirectoryWrapper.SetMaxWriteMBPerSec(maxMBPerSec, IOContext.Context_e.FLUSH);
+                        rateLimitedDirectoryWrapper.SetMaxWriteMBPerSec(maxMBPerSec, IOContext.UsageContext.FLUSH);
                         break;
 
                     case 2: // sometimes rate limit flush & merge
-                        rateLimitedDirectoryWrapper.SetMaxWriteMBPerSec(maxMBPerSec, IOContext.Context_e.FLUSH);
-                        rateLimitedDirectoryWrapper.SetMaxWriteMBPerSec(maxMBPerSec, IOContext.Context_e.MERGE);
+                        rateLimitedDirectoryWrapper.SetMaxWriteMBPerSec(maxMBPerSec, IOContext.UsageContext.FLUSH);
+                        rateLimitedDirectoryWrapper.SetMaxWriteMBPerSec(maxMBPerSec, IOContext.UsageContext.MERGE);
                         break;
 
                     default:
-                        rateLimitedDirectoryWrapper.SetMaxWriteMBPerSec(maxMBPerSec, IOContext.Context_e.MERGE);
+                        rateLimitedDirectoryWrapper.SetMaxWriteMBPerSec(maxMBPerSec, IOContext.UsageContext.MERGE);
                         break;
                 }
                 directory = rateLimitedDirectoryWrapper;


Mime
View raw message