lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccurr...@apache.org
Subject [Lucene.Net] svn commit: r1203127 - in /incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk: src/core/ src/core/Index/ test/core/Index/
Date Thu, 17 Nov 2011 09:42:32 GMT
Author: ccurrens
Date: Thu Nov 17 09:42:31 2011
New Revision: 1203127

URL: http://svn.apache.org/viewvc?rev=1203127&view=rev
Log:
finished porting of core/index.  3 tests will fail in release, pass when debugger attached.

Modified:
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/FreqProxTermsWriter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/FreqProxTermsWriterPerField.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/NormsWriterPerField.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/PositionBasedTermVectorMapper.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/TermVectorEntryFreqSortedComparator.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestPositionBasedTermVectorMapper.cs

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt?rev=1203127&r1=1203126&r2=1203127&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt Thu Nov 17
09:42:31 2011
@@ -120,17 +120,17 @@ index\
 	index\FieldsWriter.java - PORTED
 	index\FilterIndexReader.java - PORTED
 	index\FormatPostingsDocsConsumer.java - IDENTICAL
-	index\FormatPostingsDocsWriter.java - Text files are different
+	index\FormatPostingsDocsWriter.java - PORTED
 	index\FormatPostingsFieldsConsumer.java - IDENTICAL
-	index\FormatPostingsFieldsWriter.java - Text files are different
-	index\FormatPostingsPositionsConsumer.java - Text files are different
-	index\FormatPostingsPositionsWriter.java - Text files are different
+	index\FormatPostingsFieldsWriter.java - PORTED
+	index\FormatPostingsPositionsConsumer.java - PORTED
+	index\FormatPostingsPositionsWriter.java - PORTED
 	index\FormatPostingsTermsConsumer.java - IDENTICAL
-	index\FormatPostingsTermsWriter.java - Text files are different
+	index\FormatPostingsTermsWriter.java - PORTED
 	index\FreqProxFieldMergeState.java - IDENTICAL
-	index\FreqProxTermsWriter.java - Text files are different
-	index\FreqProxTermsWriterPerField.java - Text files are different
-	index\FreqProxTermsWriterPerThread.java - Text files are different
+	index\FreqProxTermsWriter.java - PORTED
+	index\FreqProxTermsWriterPerField.java - PORTED
+	index\FreqProxTermsWriterPerThread.java - PORTED
 	index\IndexCommit.java - DONE
 	index\IndexCommitPoint.java - Removed in 3.x
 	index\IndexDeletionPolicy.java - PORTED
@@ -159,12 +159,12 @@ index\
 	index\MultipleTermPositions.java - PORTED
 	index\MultiReader.java - PORTED
 	index\NormsWriter.java - PORTED
-	index\NormsWriterPerField.java - Text files are different
-	index\NormsWriterPerThread.java - Text files are different
+	index\NormsWriterPerField.java - PORTED
+	index\NormsWriterPerThread.java - PORTED
 	index\package.html - IDENTICAL
 	index\ParallelReader.java - PORTED
-	index\Payload.java - Text files are different
-	index\PositionBasedTermVectorMapper.java - Text files are different
+	index\Payload.java - PORTED
+	index\PositionBasedTermVectorMapper.java - PORTED
 	index\RawPostingList.java - IDENTICAL
 	index\ReadOnlyDirectoryReader.java - PORTED
 	index\ReadOnlySegmentReader.java - PORTED
@@ -198,19 +198,19 @@ index\
 	index\TermPositions.java - IDENTICAL
 	index\TermPositionVector.java - IDENTICAL
 	index\TermsHash.java - PORTED
-	index\TermsHashConsumer.java - Text files are different
+	index\TermsHashConsumer.java - PORTED
 	index\TermsHashConsumerPerField.java - IDENTICAL
 	index\TermsHashConsumerPerThread.java - IDENTICAL
-	index\TermsHashPerField.java - Text files are different
-	index\TermsHashPerThread.java - Text files are different
-	index\TermVectorEntry.java - Text files are different
-	index\TermVectorEntryFreqSortedComparator.java - Text files are different
+	index\TermsHashPerField.java - PORTED
+	index\TermsHashPerThread.java - PORTED
+	index\TermVectorEntry.java - PORTED
+	index\TermVectorEntryFreqSortedComparator.java - PORTED
 	index\TermVectorMapper.java - IDENTICAL
 	index\TermVectorOffsetInfo.java - PORTED
 	index\TermVectorsReader.java - PORTED
-	index\TermVectorsTermsWriter.java - Text files are different
-	index\TermVectorsTermsWriterPerField.java - Text files are different
-	index\TermVectorsTermsWriterPerThread.java - Text files are different
+	index\TermVectorsTermsWriter.java - PORTED
+	index\TermVectorsTermsWriterPerField.java - PORTED
+	index\TermVectorsTermsWriterPerThread.java - PORTED
 	index\TermVectorsWriter.java - IDENTICAL
 
 messages\
@@ -325,7 +325,7 @@ search
 	IndexSearcher.java - PORTED
 	MatchAllDocsQuery.java - PORTED
 	MultiPhraseQuery.java - PORTED
-	MultiSearcher.java - PORTED * Double check on MultiSearcherCallableNoSort/Sort, use use
of new Object() rather than dummy lock.  Shouldn't make a difference, seems to be used because
ParallelMultiSearcher uses a ReEntrantLock instead of synchronized
+	MultiSearcher.java - PORTED * Double check on MultiSearcherCallableNoSort/Sort, use of new
Object() rather than dummy lock.  Shouldn't make a difference, seems to be used because ParallelMultiSearcher
uses a ReEntrantLock instead of synchronized
 	MultiTermQuery.java - Text files are different
 	MultiTermQueryWrapperFilter.java - Text files are different
 	NumericRangeFilter.java - Text files are different

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/FreqProxTermsWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/FreqProxTermsWriter.cs?rev=1203127&r1=1203126&r2=1203127&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/FreqProxTermsWriter.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/FreqProxTermsWriter.cs
Thu Nov 17 09:42:31 2011
@@ -67,7 +67,6 @@ namespace Lucene.Net.Index
 		// FreqProxFieldMergeState, and code to visit all Fields
 		// under the same FieldInfo together, up into TermsHash*.
 		// Other writers would presumably share alot of this...
-
         public override void Flush(IDictionary<TermsHashConsumerPerThread, ICollection<TermsHashConsumerPerField>>
threadsAndFields, SegmentWriteState state)
 		{
 			

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/FreqProxTermsWriterPerField.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/FreqProxTermsWriterPerField.cs?rev=1203127&r1=1203126&r2=1203127&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/FreqProxTermsWriterPerField.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/FreqProxTermsWriterPerField.cs
Thu Nov 17 09:42:31 2011
@@ -26,7 +26,7 @@ namespace Lucene.Net.Index
 	// TODO: break into separate freq and prox writers as
 	// codecs; make separate container (tii/tis/skip/*) that can
 	// be configured as any number of files 1..N
-	sealed class FreqProxTermsWriterPerField:TermsHashConsumerPerField, System.IComparable
+	sealed class FreqProxTermsWriterPerField:TermsHashConsumerPerField, System.IComparable<FreqProxTermsWriterPerField>
 	{
 		
 		internal FreqProxTermsWriterPerThread perThread;
@@ -65,9 +65,8 @@ namespace Lucene.Net.Index
 		{
 		}
 		
-		public int CompareTo(System.Object other0)
+		public int CompareTo(FreqProxTermsWriterPerField other)
 		{
-			FreqProxTermsWriterPerField other = (FreqProxTermsWriterPerField) other0;
 			return String.CompareOrdinal(fieldInfo.name, other.fieldInfo.name);
 		}
 		

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/NormsWriterPerField.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/NormsWriterPerField.cs?rev=1203127&r1=1203126&r2=1203127&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/NormsWriterPerField.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/NormsWriterPerField.cs
Thu Nov 17 09:42:31 2011
@@ -29,7 +29,7 @@ namespace Lucene.Net.Index
 	/// and record the norm. 
 	/// </summary>
 	
-	sealed class NormsWriterPerField:InvertedDocEndConsumerPerField, System.IComparable
+	sealed class NormsWriterPerField:InvertedDocEndConsumerPerField, System.IComparable<NormsWriterPerField>
 	{
 		
 		internal NormsWriterPerThread perThread;
@@ -64,9 +64,9 @@ namespace Lucene.Net.Index
 			upto = 0;
 		}
 		
-		public int CompareTo(System.Object other)
+		public int CompareTo(NormsWriterPerField other)
 		{
-			return String.CompareOrdinal(fieldInfo.name, ((NormsWriterPerField) other).fieldInfo.name);
+			return String.CompareOrdinal(fieldInfo.name, other.fieldInfo.name);
 		}
 		
 		internal override void  Finish()

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/PositionBasedTermVectorMapper.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/PositionBasedTermVectorMapper.cs?rev=1203127&r1=1203126&r2=1203127&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/PositionBasedTermVectorMapper.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/PositionBasedTermVectorMapper.cs
Thu Nov 17 09:42:31 2011
@@ -16,6 +16,8 @@
  */
 
 using System;
+using System.Collections.Generic;
+using Lucene.Net.Support;
 
 namespace Lucene.Net.Index
 {
@@ -26,19 +28,13 @@ namespace Lucene.Net.Index
 	/// </summary>
 	public class PositionBasedTermVectorMapper:TermVectorMapper
 	{
-		private System.Collections.IDictionary fieldToTerms;
+		private IDictionary<string, IDictionary<int, TVPositionInfo>> fieldToTerms;
 		
 		private System.String currentField;
 		/// <summary> A Map of Integer and TVPositionInfo</summary>
-		private System.Collections.IDictionary currentPositions;
+        private IDictionary<int, TVPositionInfo> currentPositions;
 		private bool storeOffsets;
 		
-		
-		
-		
-		/// <summary> 
-		/// 
-		/// </summary>
 		public PositionBasedTermVectorMapper():base(false, false)
 		{
 		}
@@ -68,8 +64,8 @@ namespace Lucene.Net.Index
 		{
 			for (int i = 0; i < positions.Length; i++)
 			{
-				System.Int32 posVal = (System.Int32) positions[i];
-				TVPositionInfo pos = (TVPositionInfo) currentPositions[posVal];
+				System.Int32 posVal =  positions[i];
+				TVPositionInfo pos = currentPositions[posVal];
 				if (pos == null)
 				{
 					pos = new TVPositionInfo(positions[i], storeOffsets);
@@ -98,10 +94,10 @@ namespace Lucene.Net.Index
 			{
 				//ignoring offsets
 			}
-			fieldToTerms = new System.Collections.Hashtable(numTerms);
+			fieldToTerms = new HashMap<string, IDictionary<int, TVPositionInfo>>(numTerms);
 			this.storeOffsets = storeOffsets;
 			currentField = field;
-			currentPositions = new System.Collections.Hashtable();
+			currentPositions = new HashMap<int, TVPositionInfo>();
 			fieldToTerms[currentField] = currentPositions;
 		}
 		
@@ -110,7 +106,7 @@ namespace Lucene.Net.Index
 		/// </summary>
 		/// <returns> A map between field names and a Map.  The sub-Map key is the position
as the integer, the value is <see cref="Lucene.Net.Index.PositionBasedTermVectorMapper.TVPositionInfo"
/>.
 		/// </returns>
-		public virtual System.Collections.IDictionary GetFieldToTerms()
+        public virtual IDictionary<string, IDictionary<int, TVPositionInfo>>
GetFieldToTerms()
 		{
 			return fieldToTerms;
 		}
@@ -132,7 +128,7 @@ namespace Lucene.Net.Index
 			/// <summary> Note, there may be multiple terms at the same position</summary>
 			/// <returns> A List of Strings
 			/// </returns>
-			virtual public System.Collections.IList Terms
+			virtual public IList<String> Terms
 			{
 				get
 				{
@@ -144,7 +140,7 @@ namespace Lucene.Net.Index
 			/// There may be multiple entries since there may be multiple terms at a position</summary>
 			/// <returns> A List of TermVectorOffsetInfo objects, if offsets are store.
 			/// </returns>
-			virtual public System.Collections.IList Offsets
+			virtual public IList<TermVectorOffsetInfo> Offsets
 			{
 				get
 				{
@@ -154,18 +150,18 @@ namespace Lucene.Net.Index
 			}
 			private int position;
 			//a list of Strings
-			private System.Collections.IList terms;
+			private IList<string> terms;
 			//A list of TermVectorOffsetInfo
-			private System.Collections.IList offsets;
+			private IList<TermVectorOffsetInfo> offsets;
 			
 			
 			public TVPositionInfo(int position, bool storeOffsets)
 			{
 				this.position = position;
-				terms = new System.Collections.ArrayList();
+				terms = new List<string>();
 				if (storeOffsets)
 				{
-					offsets = new System.Collections.ArrayList();
+					offsets = new List<TermVectorOffsetInfo>();
 				}
 			}
 			

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/TermVectorEntryFreqSortedComparator.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/TermVectorEntryFreqSortedComparator.cs?rev=1203127&r1=1203126&r2=1203127&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/TermVectorEntryFreqSortedComparator.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/TermVectorEntryFreqSortedComparator.cs
Thu Nov 17 09:42:31 2011
@@ -25,14 +25,11 @@ namespace Lucene.Net.Index
 	/// 
 	/// 
 	/// </summary>
-	//public class TermVectorEntryFreqSortedComparator : System.Collections.IComparer
-    public class TermVectorEntryFreqSortedComparator : System.Collections.Generic.IComparer<System.Object>
+    public class TermVectorEntryFreqSortedComparator : System.Collections.Generic.IComparer<TermVectorEntry>
 	{
-		public virtual int Compare(System.Object object_Renamed, System.Object object1)
+        public virtual int Compare(TermVectorEntry entry, TermVectorEntry entry1)
 		{
 			int result = 0;
-			TermVectorEntry entry = (TermVectorEntry) object_Renamed;
-			TermVectorEntry entry1 = (TermVectorEntry) object1;
 			result = entry1.GetFrequency() - entry.GetFrequency();
 			if (result == 0)
 			{

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs?rev=1203127&r1=1203126&r2=1203127&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs
Thu Nov 17 09:42:31 2011
@@ -3981,6 +3981,8 @@ namespace Lucene.Net.Index
                         isCommit = true;
                     if ("Lucene.Net.Store.MockRAMDirectory".Equals(className) &&
"DeleteFile".Equals(sf.GetMethod().Name))
                         isDelete = true;
+                    if ("Lucene.Net.Index.SegmentInfos".Equals(className))
+                        Console.WriteLine(sf.GetMethod().Name);
                 }
 
                 if (isCommit)

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestPositionBasedTermVectorMapper.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestPositionBasedTermVectorMapper.cs?rev=1203127&r1=1203126&r2=1203127&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestPositionBasedTermVectorMapper.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestPositionBasedTermVectorMapper.cs
Thu Nov 17 09:42:31 2011
@@ -81,7 +81,7 @@ namespace Lucene.Net.Index
 				System.String token = tokens[i];
 				mapper.Map(token, 1, null, thePositions[i]);
 			}
-			System.Collections.IDictionary map = mapper.GetFieldToTerms();
+			var map = mapper.GetFieldToTerms();
 			Assert.IsTrue(map != null, "map is null and it shouldn't be");
 			Assert.IsTrue(map.Count == 1, "map Size: " + map.Count + " is not: " + 1);
 			System.Collections.IDictionary positions = (System.Collections.IDictionary) map["test"];



Mime
View raw message