ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raymond Wilson <raymond_wil...@trimble.com>
Subject Error with ScanQuery
Date Mon, 16 Oct 2017 02:38:14 GMT
I have an existing Ignite (v2.2) cache using the Persistency layer that
contains a number of cache entries.



While using a test application on top of the cache I experienced an issue
where the local computer ran out of virtual memory and essentially crashed
(long story).



I have since resolved the virtual memory issue and am attempting to re-run
my application; however it is stating it cannot find information that it
could find previously in the Ignite persistent cache. The cache was not
being written to at the time of the crash, only read from.



I wanted to see if I could dump all the keys from the cache to test if the
information was present or not, and found some code that led me to write
this:



            // Obtain all the keys and write them into the file
"C:\Temp\AllRaptorIgniteCacheKeys.txt"



            using (var outFile = new FileStream(
@"C:\Temp\AllRaptorIgniteCacheKeys.txt", FileMode.Create))

            {

                using (var writer = new StreamWriter(outFile))

                {

                    IIgnite ignite = Ignition.TryGetIgnite(RaptorGrids
.RaptorGridName());



                    ICache<String, MemoryStream> cache = ignite.GetCache<
String, MemoryStream>(RaptorCaches.ImmutableNonSpatialCacheName());



                    var scanQuery = new ScanQuery<String, MemoryStream>();

                    IQueryCursor<ICacheEntry<String, MemoryStream>>
queryCursor = cache.Query(scanQuery);



                    foreach (ICacheEntry<String, MemoryStream> cacheEntry in
queryCursor)   ß Error here

                    {

                        writer.Write(cacheEntry.Key);

                    }

                }

            }





This compiles, but when it runs it fails at the line marked ‘ß Error here’
with the following exception:



   at Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.Error(Void*
target, Int32 errType, SByte* errClsChars, Int32 errClsCharsLen, SByte*
errMsgChars, Int32 errMsgCharsLen, SByte* stackTraceChars, Int32
stackTraceCharsLen, Void* errData, Int32 errDataLen)

   at
Apache.Ignite.Core.Impl.Unmanaged.IgniteJniNativeMethods.TargetInStreamOutStream(Void*
ctx, Void* target, Int32 opType, Int64 inMemPtr, Int64 outMemPtr)

   at Apache.Ignite.Core.Impl.PlatformTarget.DoOutInOp[TR](Int32 type,
Action`1 outAction, Func`2 inAction)

   at Apache.Ignite.Core.Impl.Binary.BinaryProcessor.GetTypeName(Int32 id)

   at Apache.Ignite.Core.Impl.Binary.Marshaller.GetDescriptor(Boolean
userType, Int32 typeId, Boolean requiresType, String typeName, Type
knownType)

   at Apache.Ignite.Core.Impl.Binary.BinaryReader.ReadFullObject[T](Int32
pos, Type typeOverride)

   at Apache.Ignite.Core.Impl.Binary.BinaryReader.TryDeserialize[T](T& res,
Type typeOverride)

   at Apache.Ignite.Core.Impl.Binary.BinaryReader.Deserialize[T](Type
typeOverride)

   at
Apache.Ignite.Core.Impl.Binary.BinaryReader.ReadBinaryObject[T](Boolean
doDetach)

   at Apache.Ignite.Core.Impl.Binary.BinaryReader.TryDeserialize[T](T& res,
Type typeOverride)

   at Apache.Ignite.Core.Impl.Binary.BinaryReader.Deserialize[T](Type
typeOverride)

   at Apache.Ignite.Core.Impl.Cache.Query.QueryCursor`2.Read(BinaryReader
reader)

   at
Apache.Ignite.Core.Impl.Cache.Query.AbstractQueryCursor`1.ConvertGetBatch(IBinaryStream
stream)

   at Apache.Ignite.Core.Impl.PlatformTarget.DoInOp[T](Int32 type, Func`2
action)

   at
Apache.Ignite.Core.Impl.Cache.Query.AbstractQueryCursor`1.RequestBatch()

   at Apache.Ignite.Core.Impl.Cache.Query.AbstractQueryCursor`1.MoveNext()

   at VSS.Raptor.IgnitePOC.TestApp.Form1.button1_Click(Object sender,
EventArgs e) in
C:\Dev\VSS.Raptor.IgnitePOC\WindowsFormsApplication1\Form1.cs:line 252



When I inspect the ‘Current’ member of the  scanQuery variable I see this
error displayed for it (which is present before executing the ScanQuery):




'((Apache.Ignite.Core.Impl.Cache.Query.AbstractQueryCursor<Apache.Ignite.Core.Cache.ICacheEntry<string,
System.IO.MemoryStream>>)queryCursor).Current' threw an exception of type
'System.InvalidOperationException'



The specific error reported by the Visual Studio IDE is:







I’m a bit puzzled what is happening. It seems I can’t tell if there is
still information in the cache because the ScanQuery does not work. I don’t
know if this is because of corruption or damage in the cache, or because
I’m using a ScanQuery with a null filter or if something has changed to
make a <string, MemoryStream> type cache fail to map that object type onto
the members in the cache (which is a <String, MemoryStream> type cache).



Thanks,

Raymond.

Mime
View raw message