|
|
Comments and Discussions
|
|
 |

|
Great for diverting blame from your department
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
exactly
|
|
|
|

|
Hey,
So I was noticing that the size of my storage file was increasing a lot more than I would have expected it to. When you do the following:
Sample temp = DB.Fetch(DocID);
temp.Values.Add("new value");
DB.Save(temp, temp.ID);
Is the old instance of temp with the ID DocID in the storage file overwritten, or is the old instance kept and the updated object just appended to the storage file? I read on codeplex your justification of the delete behavior and in it you mentioned that the storage files were implemented to be append only which might be why I'm having issues.
What I'm seeing is that I have an object that contains a list which I append to every few minutes and I then write back this object to the DB. After about 250 iterations of adding to this list I'm serializing this object to a JSON string and writing this to a text file, which ends up being about 10MB in size. This size is reasonable for this object which stores a large amount of data but what I notice is that the size of the data.mgdat file has increased to about 1.5GB. Does this sound like the correct behavior?
|
|
|
|

|
The storage file are append only, so deletes and changes are appended and the original data is kept.
So if you have a doc with ID=1 and save it 100 times you will have 100 copies in the storage file with ID=1 but if you Fetch that ID you will get the last one (I will add a method to get the list of the previous changes for that ID which is lacking at the moment).
For an object of ~10mb and you are saving it 250 times then the size of the mgdat file seems reasonable.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|

|
Are Save/Fetch Bytes supported in Server Mode? When I savebytes the return value is true, but attempting to fetchbytes returns null. Are there any other feature differences between embedded and server modes that I should be aware of?
Thanks
|
|
|
|

|
They should be the same, I will look into it.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Oops!
Add the following in RaptorDBClient.cs line 104 :
...
case "savebytes":
ret.OK = _raptor.SaveBytes(p.Docid, (byte[])p.Data); break;
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
That did it!
One note, that code needs to be to RaptorDBServer.cs line 104.
Thanks!
|
|
|
|

|
Sorry, yes my mistake.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hey,
I'm seeing an issue if I start up RaptorDB in server mode, then write to the database from the same process that started the DB in server mode. I'm able to write to the DB running in server mode from a separate process/exe with no problems.
Some sample code below.
Console.WriteLine("Starting DB in server mode");
RaptorDBServer server = new RaptorDBServer(90, "_data");
Console.WriteLine("Connecting to DB in server mode");
IRaptorDB DB = new RaptorDBClient("localhost", 90, "admin", "admin");
Sample obj = new Sample(){
Name = "Object",
OtherValue = "Other value for object 1"
};
DB.Save(obj.ID, obj);
DB.Shutdown();
server.Shutdown();
The exception is in the DB log which I've included below.
2012-12-17 11:39:09|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB starting...
2012-12-17 11:39:09|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB data folder = C:\testRaptorDB\bin\Debug\_data\
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 0
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 0
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-17 11:39:10|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue starting
2012-12-17 11:39:10|DEBUG|1|RaptorDB.Hoot|| Starting hOOt....
2012-12-17 11:39:10|DEBUG|1|RaptorDB.Hoot|| Storage Folder = C:\testRaptorDB\bin\Debug\_data\Data\Fulltext\
2012-12-17 11:39:10|DEBUG|1|RaptorDB.RaptorDBServer|| loading dll for views : C:\testRaptorDB\bin\Debug\Extensions\testLib.dll
2012-12-17 11:39:11|DEBUG|1|RaptorDB.Views.ViewHandler|| Rebuilding view from scratch...
2012-12-17 11:39:11|DEBUG|1|RaptorDB.Views.ViewHandler|| View = SampleView
2012-12-17 11:39:11|DEBUG|1|RaptorDB.Views.ViewHandler|| rebuild done (s) = 0
2012-12-17 11:39:16|ERROR|7|RaptorDB.RaptorDBServer|| System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Unable to cast object of type 'testLib.SampleView' to type 'RaptorDB.View`1[testLib.Sample]'.
at RaptorDB.Views.ViewHandler.Insert[T](Guid guid, T doc) in c:\RaptorDB\v1.9.0\RaptorDB\Views\ViewHandler.cs:line 132
at RaptorDB.Views.ViewManager.Insert[T](String viewname, Guid docid, T data) in c:\v1.9.0\RaptorDB\Views\ViewManager.cs:line 191
at RaptorDB.RaptorDB.SaveInPrimaryView[T](String viewname, Guid docid, T data) in c:\RaptorDB\v1.9.0\RaptorDB\RaptorDB.cs:line 508
at RaptorDB.RaptorDB.Save[T](Guid docid, T data) in c:\RaptorDB\v1.9.0\RaptorDB\RaptorDB.cs:line 128
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at RaptorDB.RaptorDBServer.processpayload(Object data) in c:\RaptorDB\v1.9.0\RaptorDB\RaptorDBServer.cs:line 102
2012-12-17 11:39:17|DEBUG|4|RaptorDB.Common.NetworkServer|| tcp connects/sec = 1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Hoot|| saving index...
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Hoot|| save time (ms) = 3.9208
2012-12-17 11:39:17|DEBUG|1|RaptorDB.RaptorDB|| last full text record = -1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.RaptorDB|| last record = -1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.RaptorDB|| last backup record = -1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.RaptorDB|| Shutting down
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.ViewManager|| View Manager shutdown
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue shutdown
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.ViewManager|| shutting down view : SampleView
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down Viewhandler
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : docid
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-17 11:39:17|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : Name
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-17 11:39:17|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-17 11:39:17|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down
2012-12-17 11:39:17|DEBUG|1|RaptorDB.KeyStore`1|| saving to disk
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.KeyStore`1|| index saved
2012-12-17 11:39:17|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-17 11:39:17|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-17 11:39:18|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down log
|
|
|
|

|
Are you sure the types are the same?
Quote: 'testLib.SampleView' to type 'RaptorDB.View`1[testLib.Sample]
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Sorry, I meant to add the Sample object definition as well. I've included it below.
As far as I can tell they are the same and when I set a break point at line 132 in ViewHandler.cs I can see
- The parameter doc, which is passed to the method, is of type testLib.Sample
- _view is of type testLib.SampleView
This looks like it should work to me.
If I change to using the DB as an embedded DB it works fine, it's only when I have it in server mode.
public class Sample
{
public Guid ID;
public string Name;
public string OtherValue;
public Sample()
{
}
}
[RegisterView]
public class SampleView : View<Sample>
{
public class RowSchema : RDBSchema
{
public string Name;
}
public SampleView()
{
this.Name = "SampleView";
this.Description = "A primary view for sample objects";
this.isPrimaryList = true;
this.isActive = true;
this.BackgroundIndexing = false;
this.Schema = typeof(SampleView.RowSchema);
this.AddFireOnTypes(typeof(Sample));
this.Mapper = (api, docid, doc) =>
{
api.EmitObject(docid, doc);
};
}
}
|
|
|
|

|
One thing I have noticed is that the DLL files can be loaded from different locations and you will get errors like this, one workaround is to make sure you are referencing and loading the same dll files, or you could use the GAC and strong name your assemblies.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Ok from what you said it gave me a better idea of what to look at to solve the issue and I've found a fix although it's not ideal. I've included the code changes below.
The directory structure of my compiled project is this
_data
Backup
Data
Logs
Restore
Temp
Views
Extensions
testLib.dll
users.config
testRaptorDB.exe
testLib.dll
RaptorDB.dll
RaptorDB.Common.dll
- I can connect and insert records to the "_data" db fine in embedded mode
- In server mode I get a System.InvalidCastException when I try to insert records.
You mentioned that you have seen this issue when DLL files are loaded from different locations. The only different location that is used in server mode compared to embedded mode is "testLib.dll" under "Extensions".
So I modified line 255 in RaptorDBServer.cs so that we don't load views from "Extensions" but instead from the DLL's in local path.
string path = _path;
foreach (var f in Directory.GetFiles(path, "*.dll"))
{
When I do this then I can insert in server mode without any exceptions and everything works as I would expect it to. So it looks like there's issues with loading views from DLL's in the "Extensions" directory in Server mode if you also want to insert into the DB from that same executable. This is because to insert you also need to include the same DLL from the "Extensions" directory in your local directory which cause a conflict of some sort on insertion.
This fix isn't ideal because the server now has to read all DLL's in our local directory but a solution for this may be to add a Extensions file that specifies which DLL's to read as opposed to the current method of loading all the DLL's from the Extensions directory.
modified 19 Dec '12 - 8:18.
|
|
|
|

|
Does this look like a reasonable solution, can you think of any knock on effects this might have?
It's been working fine for me so far. I'll let you know if I have any issues.
|
|
|
|

|
The only problem is that you have to make sure the dll's are the same when you update your code and make sure you copy them to both places.
A much cleaner approach is to put the dll's in GAC.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
The application I've been using RaptorDB for is a ClickOnce app so I can't install DLL's to the GAC. I did test with installing to the GAC and this stops the issue I'm seeing occuring but as I said this solution doesn't work for my particular situation.
If it's not a priority for you to develop functionality to support this, then would you be interested in adding this functionality if I implemented it? One way to implement server mode view registration could be:
- the server checks for an Extensions directory get the list of DLL's in this directory
- the server then checks for a Extensions.regview file
- this file would contain the paths to any other DLL's that the user wants to register views from
- register views from the two lists of DLL's
Does that sound ok to you?
Thanks again for the help, RaptorDB seems to be great and I'm slowly getting to grips with it's inner workings. I hope I'll be able to contribute back to the codebase soon as well.
|
|
|
|

|
I trying this against v1.9.0
I'm unable to retrieve all results for a certain type in Server mode but it does work in embedded mode fine.
My object and view definition are here:
public class Sample
{
public Guid ID;
public string Name;
public string OtherValue;
public Sample()
{
}
}
[RegisterView]
public class SampleView : View<Sample>
{
public class RowSchema : RDBSchema
{
public string Name;
}
public SampleView()
{
this.Name = "SampleView";
this.Description = "A primary view for sample objects";
this.isPrimaryList = true;
this.isActive = true;
this.BackgroundIndexing = false;
this.Schema = typeof(SampleView.RowSchema);
this.AddFireOnTypes(typeof(Sample));
this.Mapper = (api, docid, doc) =>
{
api.EmitObject(docid, doc);
};
}
}
I've tried a number of different query formats and they're all working against the DB running in Embedded mode but not when I access it in Server mode. I've included a test case and all the query formats I've tried below. The query formats I've tried are:
DB.Query("SampleView"); DB.Query(typeof(Sample)); DB.Query(typeof(SampleView)); DB.Query(typeof(SampleView.RowSchema));
DB.Query("SampleView", (SampleView.RowSchema v) => v.Name == "Object"); DB.Query(typeof(Sample), (SampleView.RowSchema v) => v.Name == "Object"); DB.Query(typeof(SampleView), (SampleView.RowSchema v) => v.Name == "Object"); DB.Query(typeof(SampleView.RowSchema), (SampleView.RowSchema v) => v.Name == "Object"); DB.Query<SampleView.RowSchema>(v => v.Name == "Object"); DB.Query<SampleView.RowSchema>("Name = \"Object\"");
I'm getting 3 different behaviors for the query formats when run against the DB in Server mode, these are
- I get back a Result<object> list with a size of 0
- I get back a null result
- I get the following exception
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Cast[TResult](IEnumerable source)
at RaptorDB.RaptorDBClient.GenericResult[T](Result`1 res) in c:\RaptorDB\v1.9.0\RaptorDB.Common\RaptorDBClient.cs:line 475
at RaptorDB.RaptorDBClient.Query[T](Expression`1 filter, Int32 start, Int32 c
ount) in c:\RaptorDB\v1.9.0\RaptorDB.Common\RaptorDBClient.cs:line 469
at RaptorDB.RaptorDBClient.Query[T](Expression`1 filter) in c:\RaptorDB\v1.9.0\RaptorDB.Common\RaptorDBClient.cs:line 455
at testRaptorDB.Program.ReadAllObjects() in c:\testRaptorDB\testRaptorDB\Program.cs:line 104
I've written a test case to demonstrate my issue below. I compiled it, copied the dll with the Sample object and SampleView definitions into the "Extensions" directory and then ran the test case with the various query formats I specified above (which are available but commented out in the test case). Am I do anything obviously wrong? I'm just looking for any way of fetching all objects of a particular type from the database while running in Server mode.
using System;
using System.Linq;
using System.IO;
using RaptorDB;
using RaptorDB.Common;
class Program
{
static int waitTime = 5;
static string dataPath = "_data";
static IRaptorDB DB = null;
static Sample[] SampleArray =
{
new Sample
{
ID = Guid.NewGuid(),
Name = "Object",
OtherValue = "other value for object 1"
},
new Sample
{
ID = Guid.NewGuid(),
Name = "Object",
OtherValue = "other value for object 2"
}
};
public static void Main(string[] args)
{
Console.WriteLine("Delete database directory if it already exists");
Directory.Delete(dataPath, true);
Console.WriteLine("Connecting to DB in embedded mode");
DBInit();
WriteSampleData();
Wait();
ReadAllObjects();
Console.WriteLine("Closing DB in embedded mode");
DB.Shutdown();
Console.WriteLine("Starting DB in server mode");
RaptorDBServer server = new RaptorDBServer(90, dataPath);
Console.WriteLine("Connecting to DB in server mode");
DB = new RaptorDBClient("localhost", 90, "admin", "admin");
ReadAllObjects();
DB.Shutdown();
server.Shutdown();
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
static void DBInit()
{
Console.WriteLine("Initialise database");
RaptorDB.RaptorDB rapDB = RaptorDB.RaptorDB.Open(dataPath);
rapDB.RegisterView( new SampleView());
DB = rapDB;
}
static void WriteSampleData()
{
foreach(Sample obj in SampleArray)
{
Console.WriteLine("{0} : {1} : {2}", obj.ID.ToString(), obj.Name, obj.OtherValue);
DB.Save(obj.ID, obj);
}
}
static void ReadAllObjects()
{
Console.WriteLine("Read back all data from DB\n");
try
{
var list = DB.Query("SampleView");
if(list.Count > 0)
{
Console.WriteLine("-- {0} SampleView retrieved", list.Count);
foreach(SampleView.RowSchema row in list.Rows)
{
Console.WriteLine("-- ViewRow {0}: {1}", row.docid.ToString(), row.Name);
Console.WriteLine("");
}
}
else
Console.WriteLine("-- 0 SampleView retrieved");
}
catch(Exception e)
{
Console.WriteLine("Error: {0}", e.ToString());
}
}
static void Wait()
{
Console.Write("\nWait a few seconds to make sure records are written");
for(int i =0; i< waitTime; i++)
{
Console.Write(".");
System.Threading.Thread.Sleep(1000);
}
Console.WriteLine("\n");
}
}
Command Line Output
Delete database directory if it already exists
Connecting to DB in embedded mode
Initialise database
3ae79e98-b64e-4a64-99bc-98d697105630 : Object : other value for object 1
978e9367-2299-4a9c-9c45-536957840fc5 : Object : other value for object 2
Wait a few seconds to make sure records are written.....
Read back all data from DB
-- 2 SampleView retrieved
-- ViewRow 3ae79e98-b64e-4a64-99bc-98d697105630: Object
-- ViewRow 978e9367-2299-4a9c-9c45-536957840fc5: Object
Closing DB in embedded mode
Starting DB in server mode
Connecting to DB in server mode
Read back all data from DB
Error: System.NullReferenceException: Object reference not set to an instance of an object.
at testRaptorDB.Program.ReadAllObjects() in c:\testRaptorDB\testRaptorDB\Program.cs
Log file from DB directory
2012-12-10 05:49:11|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB starting...
2012-12-10 05:49:11|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB data folder = C:\testRaptorDB\testRaptorDB\bin\Debug\_data\
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 0
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 0
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue starting
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Hoot|| Starting hOOt....
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Hoot|| Storage Folder = C:\testRaptorDB\testRaptorDB\bin\Debug\_data\Data\Fulltext\
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Views.ViewHandler|| Rebuilding view from scratch...
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Views.ViewHandler|| View = SampleView
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Views.ViewHandler|| rebuild done (s) = 0
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewHandler|| query : SampleView
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewHandler|| query rows fetched (ms) : 10.7833
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewHandler|| query rows count : 2
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Hoot|| saving index...
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Hoot|| save time (ms) = 2.9409
2012-12-10 05:49:17|DEBUG|1|RaptorDB.RaptorDB|| last full text record = -1
2012-12-10 05:49:17|DEBUG|1|RaptorDB.RaptorDB|| last record = 1
2012-12-10 05:49:17|DEBUG|1|RaptorDB.RaptorDB|| last backup record = -1
2012-12-10 05:49:17|DEBUG|1|RaptorDB.RaptorDB|| Shutting down
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewManager|| View Manager shutdown
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue shutdown
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewManager|| shutting down view : SampleView
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down Viewhandler
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : docid
2012-12-10 05:49:17|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:17|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:18|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:18|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:18|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : Name
2012-12-10 05:49:18|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:18|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:18|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:18|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:19|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down
2012-12-10 05:49:19|DEBUG|1|RaptorDB.KeyStore`1|| saving to disk
2012-12-10 05:49:19|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:19|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:19|DEBUG|1|RaptorDB.KeyStore`1|| index saved
2012-12-10 05:49:19|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:19|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:19|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down log
2012-12-10 05:49:20|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB starting...
2012-12-10 05:49:20|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB data folder = C:\testRaptorDB\testRaptorDB\bin\Debug\_data\
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 2
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 0
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-10 05:49:20|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue starting
2012-12-10 05:49:20|DEBUG|1|RaptorDB.Hoot|| Starting hOOt....
2012-12-10 05:49:20|DEBUG|1|RaptorDB.Hoot|| Storage Folder = C:\testRaptorDB\testRaptorDB\bin\Debug\_data\Data\Fulltext\
2012-12-10 05:49:20|DEBUG|1|RaptorDB.RaptorDBServer|| loading dll for views : C:\testRaptorDB\testRaptorDB\bin\Debug\Extensions\testLib.dll
2012-12-10 05:49:21|DEBUG|5|RaptorDB.RaptorDB|| byte[] is null
2012-12-10 05:49:21|DEBUG|5|RaptorDB.RaptorDB|| curr rec = 2
2012-12-10 05:49:21|DEBUG|5|RaptorDB.RaptorDB|| last rec = 2
2012-12-10 05:49:21|DEBUG|6|RaptorDB.Views.ViewHandler|| query : SampleView
2012-12-10 05:49:21|DEBUG|6|RaptorDB.Views.ViewHandler|| query :
2012-12-10 05:49:21|ERROR|6|RaptorDB.RaptorDBServer|| Expression expected (at index 0)
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Hoot|| saving index...
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Hoot|| save time (ms) = 0
2012-12-10 05:49:22|DEBUG|1|RaptorDB.RaptorDB|| last full text record = -1
2012-12-10 05:49:22|DEBUG|1|RaptorDB.RaptorDB|| last record = 2
2012-12-10 05:49:22|DEBUG|1|RaptorDB.RaptorDB|| last backup record = -1
2012-12-10 05:49:22|DEBUG|1|RaptorDB.RaptorDB|| Shutting down
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.ViewManager|| View Manager shutdown
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue shutdown
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.ViewManager|| shutting down view : SampleView
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down Viewhandler
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : docid
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:22|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:22|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : Name
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:22|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:22|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:22|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down
2012-12-10 05:49:22|DEBUG|1|RaptorDB.KeyStore`1|| saving to disk
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:22|DEBUG|1|RaptorDB.KeyStore`1|| index saved
2012-12-10 05:49:22|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:22|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:22|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down log
|
|
|
|

|
Thanks!
I have found a bug in the bitmap index (probably not related), I will post that update soon.
I will look into this issue also, (the voting is off on the forums at the moment )
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Thanks, let me know if there's anything else I can help with
|
|
|
|

|
Fixed the issues, I will post an update soon.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Cheers, I just tested that there and it's working fine.
So from the different examples I gave in my test case:
- the first 4 are fixed by this
- next 2 already worked and continue to work
- the following 2 were actually as a result of this other issue that I proposed a fix for here and here
DB.Query("SampleView"); DB.Query(typeof(Sample)); DB.Query(typeof(SampleView)); DB.Query(typeof(SampleView.RowSchema));
DB.Query("SampleView", (SampleView.RowSchema v) => v.Name == "Object"); DB.Query(typeof(Sample), (SampleView.RowSchema v) => v.Name == "Object"); DB.Query(typeof(SampleView), (SampleView.RowSchema v) => v.Name == "Object"); DB.Query(typeof(SampleView.RowSchema), (SampleView.RowSchema v) => v.Name == "Object");
|
|
|
|

|
I am very impressed with the DB and I notice in your article that you have a Silverlight 5 demo screenshot but when looking at the source code you don't include support for compiling Silverlight 5 projects.
Does RaptorDB in fact work with Silverlight 5 and do you have a version of the source code that supports it?
Graeme
|
|
|
|

|
Thanks Graeme!
Microsoft nicely removed the Reflection.Emit functionality used by the fastJSON serializers in RaptorDB in Silverlight v5 (they were in v4), so RaptorDB will not compile or work with Silverlight5.
Creating a workaround is not on my todo list and frankly I feel Silverlight is a sinking ship, I would much rather switch to Android and MonoDroid which works right now.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hi,
How do I, using your example of a SalesInvoice with SalesItems, retrieve the list of SalesItems for a particular SalesInvoice? I must be missing something, because when I try to add the Items list to the Invoice view I get a Constraint error. This must be possible, but how?
Thanks
modified 28 Nov '12 - 17:25.
|
|
|
|

|
In the sample app you can use the following command :
salesitemrows , docid = "760e2d1e-dc85-4257-9287-3ef17bef1c4c"
In code queries you can do :
Guid g = new Guid("760e2d1e-dc85-4257-9287-3ef17bef1c4c");
var q = rap.Query<SalesItemRowsView.RowSchema>(x => x.docid == g);
var p = rap.Query(typeof(SalesItemRowsView), (LineItem l) => l.docid == g);
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Mehdi Gholam wrote: var q = rap.Query<SalesItemRowsView.RowSchema>(x => x.docid == g);
where g is the docid of the salesinvoice?
|
|
|
|

|
Yes it is, all data in the views are linked to the original document via the docid column/property.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
I'm getting 0 rows returned when I try this. Using a fresh download of 1.90 I add the following code to the Query sub:
if (q.Rows.Count > 0)
{
SalesInvoiceView.RowSchema si = (SalesInvoiceView.RowSchema) q.Rows[0];
Guid g = si.docid;
var q2 = rap.Query<SalesItemRowsView.RowSchema>(x => x.docid == g);
MessageBox.Show(q2.Count.ToString());
}
After inserting records, the messageBox always displays 0. Can you confirm this, or explain what I'm doing wrong?
Thanks
|
|
|
|

|
If you are doing this immediately after the insert, make sure BackgroundIndexing = false in the views you are using so you will get results and the data has been indexed.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
It appears that not all of the SalesItemRows are being inserted properly. With Background Indexing turned off, after I insert 100,000 documents a query for all SalesItemRows always returns 125,000 rows, consistently in multiple tests (I delete the db folder before each test). Shouldn't it return 500,000 rows(since we're adding 5 items per document)? I ran the test again, this time only inserting 1000 documents (with a new database), and found that only 1250 SalesItemRows were created (or retrieved). In both cases this is 25% of what it should have been. I don't know if that helps, but I can't see where I'm doing anything wrong. Could you repeat this test and see if you get the correct number of SalesItemRows?
|
|
|
|

|
If you are using the sample code the map function has the following filter in it so it is emitting less data to the views:
this.Mapper = (api, docid, doc) =>
{
if (doc.Status == 3 && doc.Items != null)
foreach (var item in doc.Items)
api.EmitObject(docid, item);
};
Hence (100,000docs)*(5items/doc)*(1/4status) = 125,000 items
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Thank you for your patience, that was indeed causing the unexpected results.
Does this filter also affect the document inserts? I ask because after I removed the filter the query still returned 1/4 of the expected results. So, I deleted the db folder, reinserted, and requeried the salesitemrows and only then received the expected results (500,000 rows).
Thanks
|
|
|
|

|
No it was only for the sales row items.
If you removed the filter you needed to rebuild the view, that could have been done by just incrementing the Version property on the view and restarting, RaptorDB would have done the rest.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|

|
Looks really impressive I'm look forward to trying it out. thanks for all the hard work
|
|
|
|
|

|
Yes I did, thanks!
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
It's fascinating - I must try it ...
|
|
|
|

|
Cheers!
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
I haven't tried Raptor yet, but one of the comments stated that things are never really deleted, so does that mean that the database just continues to get bigger?
If so, what do you do?
|
|
|
|

|
Scratch the question, I saw your answer on Codeplex, and I fully agree.
My app is a business app, and deleting records is so far down the list of priority it doesn't really matter.
We always need the history anyway!
I just need to be able to archive the database when it gets to a certain size.
|
|
|
|

|
Yep that's it.
This architecture has the added benefit that if you make a mistake or most likely the business requirements change you can "replay" the storage file like events into your new design or structure, which keeps you sane under pressure of the client and you don't have to think about it.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hi,
Loving RaptorDB and it is working well for me but one thing i don't think i have seen anywhere is how raptorDB deals with changes to enities as updates to the application are released. I am talking about adding or removing properties or renaming properties. What will RaptorDB do? Will it just save the extra fields and drop the data for the missing ones or will it raise errors? Is there some method of been able to update data from an old to new schema/entity?
|
|
|
|

|
The short : It all depends...
The long :
1) Generally if you only add properties then you are fine since previous data will fit in the new object container.
2) The problem arises when you change properties types in the new object containers and the serializers in RaptorDB cannot convert between the old and new. In this case you have the option of versioning your "data entities", this has an application overhead which you must take care of since you will have v1 and v2 of say the "Customer" object and the associated dll files and control logic must exist.
3) Since all the data is in (b)json format you always have the option of just reading the storage file and creating a new storage file for "major" changes in a tool like program.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
interesting. so if i had a field that was removed would it error or just ignore the value?
Is there a way to read then entity in a sort of anonymous object form so i could do a convert in code with out needing to have the old and new object? Not effecting me yet but i just want to know my options as i will be bound to hit it at some point. read/rewriting the bjson file could be a valid option and then triggering the build of the views again.
|
|
|
|

|
I think it will ignore the property as it gets the objects properties and reads from the json dictionary (I will have to check this in a test in fastJSON).
Not really, although the serializers support Parse() which gives a dictionary and list of object representation of the input (b)json.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Been able to Parse should be good enough if i ever needed to do something like that
|
|
|
|

|
Yep they are ignored, only the properties in the object are restored and anything else in the (b)json is ignored.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
NoSql, JSON based, Document store database with compiled .net map functions and automatic hybrid bitmap indexing and LINQ query filters (now with standalone Server mode, Backup and Active Restore, Transactions, Server side queries, MonoDroid support)
| Type | Article |
| Licence | CPOL |
| First Posted | 29 Apr 2012 |
| Views | 156,225 |
| Downloads | 5,178 |
| Bookmarked | 222 times |
|
|