Showing preview only (1,272K chars total). Download the full file or copy to clipboard to get everything.
Repository: mgholam/RaptorDB-Document
Branch: master
Commit: 4c1c2af5825e
Files: 150
Total size: 1.2 MB
Directory structure:
gitextract_wcou_a2z/
├── BuildVersion.cs
├── LICENSE
├── README.md
├── RaptorDB/
│ ├── AssemblyInfo.cs
│ ├── DataTypes/
│ │ └── DataTypes.cs
│ ├── Global.cs
│ ├── Helper/
│ │ ├── Container.cs
│ │ ├── MGRB.cs
│ │ └── WAHBitarray2.cs
│ ├── Indexes/
│ │ ├── BitmapIndex.cs
│ │ ├── Cache.cs
│ │ ├── Hoot.cs
│ │ ├── IIndex.cs
│ │ ├── ITokenizer.cs
│ │ ├── IndexFile.cs
│ │ ├── Indexes.cs
│ │ ├── MGIndex.cs
│ │ └── tokenizer.cs
│ ├── Properties/
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── REST/
│ │ ├── aWebServer.cs
│ │ └── rdbRest.cs
│ ├── RaptorDB.cs
│ ├── RaptorDB.csproj
│ ├── RaptorDBServer.cs
│ ├── Replication/
│ │ ├── Configuration.cs
│ │ ├── Packets.cs
│ │ ├── Readme.txt
│ │ ├── ReplicationClient.cs
│ │ ├── ReplicationServer.cs
│ │ └── msg.txt
│ ├── Storage/
│ │ ├── KeyStore.cs
│ │ ├── KeyStoreHF.cs
│ │ ├── StorageFile.cs
│ │ ├── StorageFileHF.cs
│ │ └── StringHF.cs
│ ├── Views/
│ │ ├── Dynamic.cs
│ │ ├── LINQQuery.cs
│ │ ├── TaskQueue.cs
│ │ ├── ViewHandler.cs
│ │ ├── ViewManager.cs
│ │ └── apimapper.cs
│ ├── WEB/
│ │ ├── bundle.css
│ │ ├── bundle.js
│ │ ├── global.css
│ │ └── index.html
│ └── cron/
│ ├── CronDaemon.cs
│ ├── CronJob.cs
│ └── CronSchedule.cs
├── RaptorDB.Common/
│ ├── DataTypes.cs
│ ├── FieldDescriptor.cs
│ ├── IRaptorDB.cs
│ ├── Interfaces.cs
│ ├── LINQString.cs
│ ├── Logger.cs
│ ├── MiniLZO.cs
│ ├── MurMurHash2.cs
│ ├── NetworkClient.cs
│ ├── Packets.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── RaptorDB.Common.csproj
│ ├── RaptorDBClient.cs
│ ├── SafeDictionary.cs
│ ├── View.cs
│ ├── ZipStorer.cs
│ ├── fastBinaryJSON/
│ │ ├── BJSON.cs
│ │ ├── BJsonParser.cs
│ │ ├── BJsonSerializer.cs
│ │ ├── Helper.cs
│ │ └── dynamic.cs
│ └── fastJSON/
│ ├── Formatter.cs
│ ├── Getters.cs
│ ├── Helper.cs
│ ├── JSON.cs
│ ├── JsonParser.cs
│ ├── JsonSerializer.cs
│ ├── Reflection.cs
│ └── dynamic.cs
├── RaptorDBCore/
│ ├── RaptorDB/
│ │ └── RaptorDB.csproj
│ ├── RaptorDb.Common/
│ │ └── RaptorDb.Common.csproj
│ └── test/
│ ├── sample.cs
│ └── test.csproj
├── RaptorDBServer/
│ ├── Installer.cs
│ ├── Program.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── RaptorDBServer.csproj
│ ├── Service1.Designer.cs
│ ├── Service1.cs
│ └── Service1.resx
├── RaptorDBTest.sln
├── RaptorDB_Doc.nuspec
├── RaptorDbCore.sln
├── Tools/
│ └── buildversion.ncs
├── Views/
│ ├── Class1.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── ServerSide.cs
│ └── Views.csproj
├── WebStudio/
│ ├── README.md
│ ├── build.cmd
│ ├── deploy.cmd
│ ├── package.json
│ ├── rollup.config.js
│ └── src/
│ ├── App.svelte
│ ├── UI/
│ │ ├── Button.svelte
│ │ ├── Modal.svelte
│ │ ├── datatable.svelte
│ │ └── nav.svelte
│ ├── debug.js
│ ├── global.css
│ ├── index.html
│ ├── main.js
│ └── pages/
│ ├── dochistory.svelte
│ ├── docsearch.svelte
│ ├── docview.svelte
│ ├── help.svelte
│ ├── hfbrowser.svelte
│ ├── query.svelte
│ ├── schema.svelte
│ ├── sysconfig.svelte
│ └── sysinfo.svelte
├── build.cmd
├── datagridbinding/
│ ├── Form1.resources
│ ├── Program.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── datagridbinding.csproj
│ ├── frmMain.Designer.cs
│ ├── frmMain.cs
│ ├── frmMain.resx
│ ├── frmStartup.Designer.cs
│ ├── frmStartup.cs
│ └── frmStartup.resx
├── history.txt
├── raptordb.snk
├── test script/
│ ├── run.cmd
│ └── sample.cs
├── testing/
│ ├── AssemblyInfo.cs
│ ├── Class1.cs
│ ├── program.cs
│ └── tests.csproj
├── testing.view
└── vbTestConsole/
├── App.config
├── Module1.vb
├── My Project/
│ ├── Application.Designer.vb
│ ├── Application.myapp
│ ├── AssemblyInfo.vb
│ ├── Resources.Designer.vb
│ ├── Resources.resx
│ ├── Settings.Designer.vb
│ └── Settings.settings
└── vbtestconsole.vbproj
================================================
FILE CONTENTS
================================================
================================================
FILE: BuildVersion.cs
================================================
using System.Reflection;
// build number = 606
// build version = 4.0.10
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.10.606")]
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2014 Mehdi Gholam
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# RaptorDB Document Store
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, HQ-Branch Replication)
see the article here : [http://www.codeproject.com/Articles/375413/RaptorDB-the-Document-Store] (http://www.codeproject.com/Articles/375413/RaptorDB-the-Document-Store)
## Quick Start
First compile the source, then you can easily run any c# file like this:
```
# run any cs file
c:\rdb\test script> ..\tools\nscript.exe sample.cs
# or just run the batch file
c:\rdb\test script> run.cmd
```
The `sample.cs` file now contains a comment section at the top for specifing references used which will tell `nscript.exe` where to find the dll files:
```
// ref : ..\output\raptordb.dll
// ref : ..\output\raptordb.common.dll
// ref : ..\faker.dll
using System;
using System.Collections.Generic;
...
```
================================================
FILE: RaptorDB/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Security;
[assembly: AssemblyTitle("RaptorDB Document Store")]
[assembly: AssemblyDescription("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, HQ-Branch Replication)")]
[assembly: AssemblyProduct("RaptorDB Document Store")]
================================================
FILE: RaptorDB/DataTypes/DataTypes.cs
================================================
using System;
using RaptorDB.Common;
namespace RaptorDB
{
/// <summary>
/// Used to track ViewDelete usage for view rebuilds
/// </summary>
internal class View_delete
{
public Guid ID = Guid.NewGuid();
public string Viewname;
public string Filter;
}
internal class View_insert
{
public Guid ID = Guid.NewGuid();
public string Viewname;
public object RowObject;
}
internal class FullTextString
{
}
internal class NoIndexing
{
}
public interface IRowFiller
{
object FillRow(object row, object[] data);
}
internal interface IGetBytes<T>
{
byte[] GetBytes(T obj);
T GetObject(byte[] buffer, int offset, int count);
}
internal class RDBDataType<T>
{
public static IGetBytes<T> ByteHandler()
{
Type type = typeof(T);
if (type == typeof(int)) return (IGetBytes<T>)new int_handler<T>();
else if (type == typeof(uint)) return (IGetBytes<T>)new uint_handler<T>();
else if (type == typeof(long)) return (IGetBytes<T>)new long_handler<T>();
else if (type == typeof(Guid)) return (IGetBytes<T>)new guid_handler<T>();
else if (type == typeof(string)) return (IGetBytes<T>)new string_handler<T>();
else if (type == typeof(DateTime)) return (IGetBytes<T>)new datetime_handler<T>();
else if (type == typeof(decimal)) return (IGetBytes<T>)new decimal_handler<T>();
else if (type == typeof(short)) return (IGetBytes<T>)new short_handler<T>();
else if (type == typeof(ushort)) return (IGetBytes<T>)new ushort_handler<T>();
else if (type == typeof(float)) return (IGetBytes<T>)new float_handler<T>();
else if (type == typeof(byte)) return (IGetBytes<T>)new byte_handler<T>();
else if (type == typeof(double)) return (IGetBytes<T>)new double_handler<T>();
return null;
}
public static byte GetByteSize(byte keysize)
{
byte size = 4;
Type t = typeof(T);
if (t == typeof(int)) size = 4;
if (t == typeof(uint)) size = 4;
if (t == typeof(long)) size = 8;
if (t == typeof(Guid)) size = 16;
if (t == typeof(DateTime)) size = 8;
if (t == typeof(decimal)) size = 16;
if (t == typeof(float)) size = 4;
if (t == typeof(short)) size = 2;
if (t == typeof(string)) size = keysize;
if (t == typeof(byte)) size = 1;
if (t == typeof(double)) size = 8;
return size;
}
internal static object GetEmpty()
{
Type t = typeof(T);
if (t == typeof(string))
return "";
return default(T);
}
}
#region [ handlers ]
internal class double_handler<T> : IGetBytes<double>
{
public byte[] GetBytes(double obj)
{
return BitConverter.GetBytes(obj);
}
public double GetObject(byte[] buffer, int offset, int count)
{
return BitConverter.ToDouble(buffer, offset);
}
}
internal class byte_handler<T> : IGetBytes<byte>
{
public byte[] GetBytes(byte obj)
{
return new byte[1] { obj };
}
public byte GetObject(byte[] buffer, int offset, int count)
{
return buffer[offset];
}
}
internal class float_handler<T> : IGetBytes<float>
{
public byte[] GetBytes(float obj)
{
return BitConverter.GetBytes(obj);
}
public float GetObject(byte[] buffer, int offset, int count)
{
return BitConverter.ToSingle(buffer, offset);
}
}
internal class decimal_handler<T> : IGetBytes<decimal>
{
public byte[] GetBytes(decimal obj)
{
byte[] b = new byte[16];
var bb = decimal.GetBits(obj);
int index = 0;
foreach (var d in bb)
{
byte[] db = Helper.GetBytes(d, false);
Buffer.BlockCopy(db, 0, b, index, 4);
index += 4;
}
return b;
}
public decimal GetObject(byte[] buffer, int offset, int count)
{
int[] i = new int[4];
i[0] = Helper.ToInt32(buffer, offset);
offset += 4;
i[1] = Helper.ToInt32(buffer, offset);
offset += 4;
i[2] = Helper.ToInt32(buffer, offset);
offset += 4;
i[3] = Helper.ToInt32(buffer, offset);
offset += 4;
return new decimal(i);
}
}
internal class ushort_handler<T> : IGetBytes<ushort>
{
public byte[] GetBytes(ushort obj)
{
return Helper.GetBytes(obj, false);
}
public ushort GetObject(byte[] buffer, int offset, int count)
{
return (ushort)Helper.ToInt16(buffer, offset);
}
}
internal class short_handler<T> : IGetBytes<short>
{
public byte[] GetBytes(short obj)
{
return Helper.GetBytes(obj, false);
}
public short GetObject(byte[] buffer, int offset, int count)
{
return Helper.ToInt16(buffer, offset);
}
}
internal class string_handler<T> : IGetBytes<string>
{
public byte[] GetBytes(string obj)
{
return Helper.GetBytes(obj);
}
public string GetObject(byte[] buffer, int offset, int count)
{
return Helper.GetString(buffer, offset, (short)count);
}
}
internal class int_handler<T> : IGetBytes<int>
{
public byte[] GetBytes(int obj)
{
return Helper.GetBytes(obj, false);
}
public int GetObject(byte[] buffer, int offset, int count)
{
return Helper.ToInt32(buffer, offset);
}
}
internal class uint_handler<T> : IGetBytes<uint>
{
public byte[] GetBytes(uint obj)
{
return Helper.GetBytes(obj, false);
}
public uint GetObject(byte[] buffer, int offset, int count)
{
return (uint)Helper.ToInt32(buffer, offset);
}
}
internal class long_handler<T> : IGetBytes<long>
{
public byte[] GetBytes(long obj)
{
return Helper.GetBytes(obj, false);
}
public long GetObject(byte[] buffer, int offset, int count)
{
return Helper.ToInt64(buffer, offset);
}
}
internal class guid_handler<T> : IGetBytes<Guid>
{
public byte[] GetBytes(Guid obj)
{
return obj.ToByteArray();
}
public Guid GetObject(byte[] buffer, int offset, int count)
{
byte[] b = new byte[16];
Buffer.BlockCopy(buffer, offset, b, 0, 16);
return new Guid(b);
}
}
internal class datetime_handler<T> : IGetBytes<DateTime>
{
public byte[] GetBytes(DateTime obj)
{
return Helper.GetBytes(obj.Ticks, false);
}
public DateTime GetObject(byte[] buffer, int offset, int count)
{
long ticks = Helper.ToInt64(buffer, offset);
return new DateTime(ticks);
}
}
#endregion
}
================================================
FILE: RaptorDB/Global.cs
================================================
namespace RaptorDB
{
public class Global
{
/// <summary>
/// Store bitmap as int offsets then switch over to bitarray
/// </summary>
public static int BitmapOffsetSwitchOverCount = 10;
/// <summary>
/// True = Save to other views in process , False = background save to other views
/// </summary>
public static bool BackgroundSaveToOtherViews = true;
/// <summary>
/// Default maximum string key size for indexes
/// </summary>
public static byte DefaultStringKeySize = 60;
/// <summary>
/// Free bitmap index memory on save
/// </summary>
public static bool FreeBitmapMemoryOnSave = false;
/// <summary>
/// Number of items in each index page (default = 10000) [Expert only, do not change]
/// </summary>
public static ushort PageItemCount = 10000;
/// <summary>
/// KeyStore save to disk timer
/// </summary>
public static int SaveIndexToDiskTimerSeconds = 1800;
/// <summary>
/// Flush the StorageFile stream immediately
/// </summary>
public static bool FlushStorageFileImmediately = false;
/// <summary>
/// Save doc as binary json
/// </summary>
public static bool SaveAsBinaryJSON = true;
/// <summary>
/// Remove completed tasks timer
/// </summary>
public static int TaskCleanupTimerSeconds = 3;
/// <summary>
/// Save to other views timer seconds if enabled
/// </summary>
public static int BackgroundSaveViewTimer = 1;
/// <summary>
/// How many items to process in a background view save event
/// </summary>
public static int BackgroundViewSaveBatchSize = 1000000;
///// <summary>
///// Check the restore folder for new backup files to restore
///// </summary>
//public static int RestoreTimerSeconds = 10; // TODO : implement this
/// <summary>
/// Timer for full text indexing of original documents (default = 15 sec)
/// </summary>
public static int FullTextTimerSeconds = 15;
/// <summary>
/// How many documents to full text index in a batch
/// </summary>
public static int BackgroundFullTextIndexBatchSize = 10000;
/// <summary>
/// Free memory checking timer (default = 300 sec ~ 5 min)
/// </summary>
public static int FreeMemoryTimerSeconds = 5 * 60;// 1800;
/// <summary>
/// Memory usage limit for internal caching (default = 100 Mb) [using GC.GetTotalMemory()]
/// </summary>
public static long MemoryLimit = 100;
/// <summary>
/// Backup cron schedule (default = "0 * * * *" [every hour])
/// </summary>
public static string BackupCronSchedule = "0 * * * *";
/// <summary>
/// Require primary view to be defined for save, false = key/value store (default = true)
/// </summary>
public static bool RequirePrimaryView = true;
/// <summary>
/// Maximum documents in each package for replication
/// </summary>
public static int PackageSizeItemCountLimit = 10000;
/// <summary>
/// Process inbox timer (default = 60 sec)
/// </summary>
public static int ProcessInboxTimerSeconds = 60;
/// <summary>
/// Split the data storage files in MegaBytes (default 0 = off) [500 = 500mb]
/// <para> - You can set and unset this value anytime and it will operate from that point on.</para>
/// <para> - If you unset (0) the value previous split files will remain and all the data will go to the last file.</para>
/// </summary>
public static ushort SplitStorageFilesMegaBytes = 0;
/// <summary>
/// Compress the documents in the storage file if it is over this size (default = 100 Kilobytes)
/// <para> - You will be trading CPU for disk IO</para>
/// </summary>
public static ushort CompressDocumentOverKiloBytes = 100;
/// <summary>
/// Disk block size for high frequency KV storage file (default = 2048)
/// <para> * Do not use anything under 512 with large string keys</para>
/// </summary>
public static ushort HighFrequencyKVDiskBlockSize = 2048;
/// <summary>
/// String key MGIndex that stores keys in an external file for smaller index files
/// </summary>
public static bool EnableOptimizedStringIndex = true;
/// <summary>
/// Enable the Web Studio interface
/// </summary>
public static bool EnableWebStudio = false;
/// <summary>
/// Web Studio port (default = 91)
/// </summary>
public static short WebStudioPort = 91;
/// <summary>
/// Local machine access only Web Studio - no network access (default = true)
/// </summary>
public static bool LocalOnlyWebStudio = true;
/// <summary>
/// If True -> less memory use SafeSortedList and slower
/// False -> more memory use SafeDictionary and faster
/// </summary>
public static bool UseLessMemoryStructures = false;
//public static bool useSortedList = false;
public static bool CompressBitmapBytes = false;
public static bool SkipDocsOnViewInsert = false;
}
}
================================================
FILE: RaptorDB/Helper/Container.cs
================================================
using System.Collections.Generic;
namespace RaptorDB
{
//----------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
class BitmapContainer : Container
{
public BitmapContainer()
{
}
public BitmapContainer(int OneCount)
{
if (OneCount > Container.BSize)
throw new System.Exception("OneCount > 65536");
else if (OneCount == Container.BSize)
ALLONE = true;
else
{
List<ulong> l = new List<ulong>();
while(OneCount>0)
{
if (OneCount > 64)
l.Add(ulong.MaxValue);
else
l.Add(ulong.MaxValue<<OneCount);
OneCount -= 64;
}
_values = l.ToArray();
Size = _values.Length * 64;
}
}
public BitmapContainer(bool allones)
{
ALLONE = allones;
}
public BitmapContainer(ulong[] vals)
{
_values = vals;
Size = _values.Length * 64;
}
public bool ALLONE = false;
ulong[] _values = null;
long _onecount = -1;
object _lock = new object();
public ulong[] Values()
{
lock (_lock)
{
if (_values != null)
return (ulong[])_values.Clone();
else
return null;
}
}
public override long CountOnes()
{
if (ALLONE)
return BSize;
if (_onecount > 0)
return _onecount;
lock (_lock)
{
long c = 0;
foreach (var l in _values)
c += BitCount(l);
_onecount = c;
return c;
}
}
public override long CountZeros()
{
if (ALLONE)
return 0;
return BSize - CountOnes();
}
public override IEnumerable<ushort> GetBitIndexes()
{
lock (_lock)
{
if (ALLONE)
{
for (int i = 0; i < BSize; i++)
yield return (ushort)i;
}
ushort c = 0;
foreach (var l in _values)
{
for (int i = 0; i < 64; i++)
{
ulong mask = (ulong)1 << (63 - i); // high order bit get
if ((l & mask) != 0)
yield return (ushort)(c + i);
}
c += 64;
}
}
}
public override bool Get(long offset)
{
lock (_lock)
{
if (ALLONE)
return true;
int pos = (ushort)offset >> 6;
int off = (int)(offset % 64);
if (pos >= _values.Length) // out of range
{
return false;
}
ulong mask = (ulong)1 << (63 - off); // high order bit get
return (_values[pos] & mask) != 0;
}
}
public override void Set(long offset, bool val)
{
lock (_lock)
{
if (ALLONE)
{
if (val == true)
return;
// change to bits
ALLONE = false;
_values = new ulong[1024];
for (int i = 0; i < 1024; i++)
_values[i] = ulong.MaxValue;
}
int pos = (ushort)offset >> 6;
int off = (int)(offset % 64);
_onecount = -1;
if (_values == null)
{
_values = new ulong[0];
}
if (pos >= _values.Length) // out of range
{
// resize
var a = new ulong[pos + 1];
_values.CopyTo(a, 0);
_values = a;
}
ulong mask = (ulong)1 << (63 - off); // high order bit get
if (val)
_values[pos] |= mask;
else
_values[pos] &= ~mask;
Size = _values.Length * 64;
}
}
public override bool ChangeRequired()
{
if (ALLONE)
return false;
if (CountOnes() == BSize) // -> all ones container
return true;
if (CountZeros() < CHGOVER) // -> inverted container
return true;
var offbytes = CountOnes() << 1; //*2
var bytes = _values.Length << 3; //*8
if (bytes > offbytes)
return true; // -> offset container
return false;
}
public override Container ToBitmap()
{
return Copy();
}
public override Container Change()
{
if (ALLONE)
return new BitmapContainer(true);
if (CountOnes() == BSize)
return new BitmapContainer(true);
// create inverted
if (CountZeros() < CHGOVER)
return new InvertedContainer(Not().GetBitIndexes());
Container c = null;
//if (Global.useSortedList)
// c = new OffsetContainerSL();
//else
c = new OffsetContainer();
foreach (var i in GetBitIndexes())
c.Set(i, true);
return c;
}
public override Container Copy()
{
if (ALLONE)
return new BitmapContainer(true);
if (_values != null && _values.Length > 0)
return new BitmapContainer(Values());
else
return new BitmapContainer();
}
public override Container Not()
{
lock (_lock)
{
if (ALLONE)
return new BitmapContainer();
var vals = new ulong[1024]; // TODO : upto Size ??
for (int i = 0; i < 1024; i++)
vals[i] = ulong.MaxValue;
for (int i = 0; i < _values.Length; i++)
vals[i] = ~_values[i];
return new BitmapContainer(vals);
}
}
}
//----------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
class OffsetContainer : Container
{
public OffsetContainer()
{
}
public OffsetContainer(IEnumerable<ushort> vals)
{
_values = new List<ushort>(vals);
Size = _values[_values.Count - 1];
}
List<ushort> _values = new List<ushort>();
private object _lock = new object();
public ushort[] Values()
{
lock (_lock)
return _values.ToArray();
}
public override Container ToBitmap()
{
lock (_lock)
{
var c = new BitmapContainer();
foreach (var i in _values)
c.Set(i, true);
return c;
}
}
public override Container Change()
{
if (CountOnes() == Container.BSize)
return new BitmapContainer(true);
if (CountZeros() < CHGOVER)
return new InvertedContainer(ToBitmap().Not().GetBitIndexes());
return ToBitmap();
}
public override bool ChangeRequired()
{
if (_values.Count > CHGOVER)
return true;
if (CountZeros() < CHGOVER)
return true;
return false;
}
public override Container Copy()
{
lock (_lock)
{
if (_values != null && _values.Count > 0)
return new OffsetContainer(_values.ToArray());
else
return new OffsetContainer();
}
}
public override long CountOnes()
{
return _values.Count;
}
public override long CountZeros()
{
return BSize - CountOnes();
}
public override bool Get(long offset)
{
lock (_lock)
{
var i = _values.BinarySearch((ushort)offset);
if (i >= 0)
return true;
return false;
}
}
public override IEnumerable<ushort> GetBitIndexes()
{
lock (_lock)
foreach (var i in _values)
yield return i;
}
public override void Set(long offset, bool val)
{
lock (_lock)
{
var i = _values.BinarySearch((ushort)offset);
if (val == true)
{
if (i < 0) // not in array -> add
{
var c = ~i;
if (c < _values.Count)
_values.Insert(c, (ushort)offset);
else
_values.Add((ushort)offset);
}
}
else if (i >= 0)
{
// remove from array
_values.RemoveAt(i);
}
if (_values.Count > 0)
Size = _values[_values.Count - 1];
else
Size = -1;
}
}
public override Container Not()
{
return ToBitmap().Not();
}
}
//----------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
class InvertedContainer : Container
{
public InvertedContainer()
{
}
// list of zeros
public InvertedContainer(IEnumerable<ushort> vals)
{
_values = new List<ushort>(vals);
if (_values.Count > 0)
Size = _values[_values.Count - 1];
else
Size = Container.BSize;
}
List<ushort> _values = new List<ushort>();
private object _lock = new object();
public override Container ToBitmap()
{
lock (_lock)
{
var b = new BitmapContainer();
foreach (var i in GetBitIndexes())
{
b.Set(i, true);
}
return b;
}
}
public override Container Change()
{
if (CountZeros() > CHGOVER)
return ToBitmap();
return Copy();
}
public override bool ChangeRequired()
{
if (CountZeros() > CHGOVER)
return true;
return false;
}
public override Container Copy()
{
lock (_lock)
{
if (_values != null && _values.Count > 0)
return new InvertedContainer(_values.ToArray());
else
return new InvertedContainer();
}
}
public override long CountOnes()
{
return BSize - CountZeros();
}
public override long CountZeros()
{
return _values.Count;
}
public override bool Get(long offset)
{
lock (_lock)
{
var i = _values.BinarySearch((ushort)offset);
if (i >= 0) // in the list of zeros
return false;
return true;
}
}
public override IEnumerable<ushort> GetBitIndexes()
{
lock (_lock)
{
for (int i = 0; i < BSize; i++)
{
var j = _values.BinarySearch((ushort)i);
if (j < 0) // not in the list of zeros
yield return (ushort)i;
}
}
}
public override Container Not()
{
return ToBitmap().Not();
}
public override void Set(long offset, bool val)
{
lock (_lock)
{
var i = _values.BinarySearch((ushort)offset);
if (val == false)
{
if (i < 0) // not in array -> add
{
var c = ~i;
if (c < _values.Count)
_values.Insert(c, (ushort)offset);
else
_values.Add((ushort)offset);
}
}
else if (i >= 0)
{
// remove from array
_values.RemoveAt(i);
}
// fix : return correct size
if (_values.Count > 0)
Size = _values[_values.Count - 1];
else
Size = -1;
}
}
public ushort[] Values()
{
lock (_lock)
return _values.ToArray();
}
}
//----------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
public abstract class Container
{
internal const int BSize = 65536;
internal const int CHGOVER = 4096;
public abstract void Set(long offset, bool val);
public abstract bool Get(long offset);
public abstract long CountOnes();
public abstract long CountZeros();
public abstract IEnumerable<ushort> GetBitIndexes();
public abstract bool ChangeRequired();
public abstract Container Change();
public abstract Container ToBitmap();
public abstract Container Copy();
public abstract Container Not();
public int Size = -1;
//[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int BitCount(ulong x)
{
x -= (x >> 1) & 0x5555555555555555UL; //put count of each 2 bits into those 2 bits
x = (x & 0x3333333333333333UL) + ((x >> 2) & 0x3333333333333333UL); //put count of each 4 bits into those 4 bits
x = (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FUL; //put count of each 8 bits into those 8 bits
return (int)((x * 0x0101010101010101UL) >> 56); //returns left 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ...
}
}
public enum CTYPE
{
ALLONES
, BITMAP
, OFFSET
, INV
//,OFFSETSL
}
public class CData
{
public ushort i;
public CTYPE t;
public byte[] d;
}
public class MGRBData
{
public List<CData> c = new List<CData>();
}
}
================================================
FILE: RaptorDB/Helper/MGRB.cs
================================================
using RaptorDB.Common;
using System;
using System.Collections.Generic;
namespace RaptorDB
{
public class MGRB
{
public MGRB()
{ }
internal MGRB(SafeSortedList<int, Container> containers) : this(containers, -1)
{ }
internal MGRB(SafeSortedList<int, Container> containers, long size)
{
_containers = containers;
var k = _containers.Keys();
_size = size;
if (size <= 0)//== -1)
{
_size = 0;
var l = k.Length - 1;
if (l >= 0)
_size = (k[l] << 16) + _containers.GetValue(l).Size;
}
}
private SafeSortedList<int, Container> _containers = new SafeSortedList<int, Container>();
private long _size;
private ushort _MASK = 0xffff;
private object _lock = new object();
public bool isDirty = false;
public long Length { get { return _size; } }
public void Set(long position, bool val)
{
lock (_lock)
{
isDirty = true;
if (_size < position && val == true)
_size = position;
var idx = (int)(position >> 16);
Container c = null;
if (_containers.TryGetValue(idx, out c) == false)
{
//if (Global.useSortedList)
// c = new OffsetContainerSL();
//else
c = new OffsetContainer();
// add container
_containers.Add(idx, c);
}
c.Set(position & _MASK, val);
//if (c.ChangeRequired())
// _containers[idx] = c.Change();
}
}
public bool Get(long position)
{
lock (_lock)
{
var idx = (int)(position >> 16);
if (_containers.TryGetValue(idx, out Container c))
return c.Get(position & _MASK);
return false;
}
}
public MGRB And(MGRB B)
{
var v = new SafeSortedList<int, Container>();
var len = _size;
if (B.Length < len)
len = B.Length;
var a = LastContainerIdx();
var b = B.LastContainerIdx();
var min = a;
if (b < min)
min = b;
min++;
for (int i = 0; i < min; i++)
{
Container ca = null;
Container cb = null;
_containers.TryGetValue(i, out ca);
B._containers.TryGetValue(i, out cb);
if (ca != null && cb != null)
v.Add(i, containerAND(ca, cb));
}
return new MGRB(v, len);
}
public MGRB Or(MGRB B)
{
var v = new SafeSortedList<int, Container>();
var len = _size;
if (B.Length > len)
len = B.Length;
var a = LastContainerIdx();
var b = B.LastContainerIdx();
var max = a;
if (b > max)
max = b;
max++;
for (int i = 0; i < max; i++)
{
Container ca = null;
Container cb = null;
_containers.TryGetValue(i, out ca);
B._containers.TryGetValue(i, out cb);
if (ca == null && cb != null)
v.Add(i, cb.Copy());
else if (cb == null && ca != null)
v.Add(i, ca.Copy());
else if (ca != null && cb != null)
v.Add(i, containerOR(ca, cb));
}
return new MGRB(v, len);
}
public MGRB AndNot(MGRB b)
{
long c = _size;
if (b._size > c)
c = b._size;
return And(b.Not(c));
}
public MGRB Not()
{
var con = new SafeSortedList<int, Container>();
foreach (var c in _containers)
{
con.Add(c.Key, c.Value.Not());
}
return new MGRB(con, _size);
}
public MGRB Not(long count)
{
var con = new SafeSortedList<int, Container>();
var c = count >> 16;
for (int i = 0; i <= c; i++)
{
Container a = null;
_containers.TryGetValue(i, out a);
if (a == null)
con.Add(i, new BitmapContainer(true));
else
con.Add(i, a.Not());
}
return new MGRB(con, count);
}
public static MGRB Fill(long count)
{
if (count == 0)
return new MGRB();
var con = new SafeSortedList<int, Container>();
int i = 0;
long c = count;
while (count > 0)
{
if (count > Container.BSize)
con.Add(i, new BitmapContainer(true));
else
con.Add(i, new BitmapContainer((int)count));
count -= Container.BSize;
i++;
}
return new MGRB(con, c);
}
public long CountOnes()
{
long c = 0;
if (_size > 0)
foreach (var i in _containers)
c += i.Value.CountOnes();
return c;
}
public long CountZeros()
{
var c = CountOnes();
return _size - c;
}
public IEnumerable<int> GetBitIndexes()
{
foreach (var c in _containers)
{
int i = c.Key << 16;
foreach (var j in c.Value.GetBitIndexes())
yield return i + j;
}
}
public MGRB Optimize()
{
lock (_lock)
{
var keys = _containers.Keys();
var remove = new List<int>();
for (int i = 0; i < keys.Length; i++)
{
var k = keys[i];
var c = _containers[k];
if (c.CountOnes() == 0)
remove.Add(k);
//else if (c.CountZeros() < Container.CHGOVER)
//{
// _containers[k] = new ZeroContainer();
//}
else if (c.ChangeRequired())
_containers[k] = c.Change();
}
foreach (var k in remove)
_containers.Remove(k);
return this;
}
}
public MGRBData Serialize()
{
var d = new MGRBData();
foreach (var c in _containers)
{
var cd = new CData();
{
cd.i = (ushort)c.Key;
if (c.Value is BitmapContainer)
{
var bm = c.Value as BitmapContainer;
cd.t = CTYPE.BITMAP;
if (bm.ALLONE)
cd.t = CTYPE.ALLONES;
else
{
// get data
cd.d = ToByteArray(bm.Values());
}
}
else if (c.Value is OffsetContainer)
{
var of = c.Value as OffsetContainer;
cd.t = CTYPE.OFFSET;
cd.d = ToByteArray(of.Values());
}
else if (c.Value is InvertedContainer)
{
var inv = c.Value as InvertedContainer;
cd.t = CTYPE.INV;
cd.d = ToByteArray(inv.Values());
}
//else
//{
// var of = c.Value as OffsetContainerSL;
// cd.t = CTYPE.OFFSETSL;
// var b = new byte[cd.d.Length];
// int k = 0;
// foreach (var i in of._values)
// {
// Buffer.BlockCopy(GetBytes(i.Key, false), 0, b, k, 2);
// k += 2;
// }
// cd.d = b;
//}
d.c.Add(cd);
}
}
return d;
}
public void Deserialize(MGRBData input)
{
foreach (var c in input.c)
{
Container con = null;
if (c.t == CTYPE.ALLONES)
{
con = new BitmapContainer(true);
}
else if (c.t == CTYPE.BITMAP)
{
List<ulong> list = new List<ulong>();
var dataLen = c.d.Length;
for (int i = 0; i < dataLen; i += 8)
{
list.Add(ToULong(c.d, i));
}
con = new BitmapContainer(list.ToArray());
}
else if (c.t == CTYPE.OFFSET)
{
List<ushort> list = new List<ushort>();
var dataLen = c.d.Length;
for (int i = 0; i < dataLen; i += 2)
{
list.Add(ToUShort(c.d, i));
}
con = new OffsetContainer(list);
}
else if (c.t == CTYPE.INV)
{
List<ushort> list = new List<ushort>();
var dataLen = c.d.Length;
for (int i = 0; i < dataLen; i += 2)
{
list.Add(ToUShort(c.d, i));
}
con = new InvertedContainer(list);
}
//else
//{
// List<ushort> list = new List<ushort>();
// var dataLen = c.d.Length;
// for (int i = 0; i < dataLen; i += 2)
// {
// list.Add(ToUShort(c.d, i));
// }
// con = new OffsetContainerSL(list);
//}
_containers.Add(c.i, con);
}
var k = _containers.Keys();
var l = k.Length - 1;
if (l >= 0)
_size = (k[l] << 16) + _containers.GetValue(l).Size;
}
public MGRB Copy()
{
if (_containers.Count() > 0)
{
var o = Serialize();
var m = new MGRB();
m.Deserialize(o);
return m;
}
return new MGRB();
}
public int GetFirst()
{
int j = 0;
foreach (var i in GetBitIndexes())
{
j = i;
break;
}
return j;
}
private int LastContainerIdx()
{
if (_containers.Count() > 0)
return _containers.Keys()[_containers.Count() - 1];
else
return 0;
}
private static Container containerAND(Container ca, Container cb)
{
BitmapContainer a = null;
BitmapContainer b = null;
if (ca is BitmapContainer)
a = (BitmapContainer)ca;
else if (ca is OffsetContainer)
a = (BitmapContainer)ca.ToBitmap();
else
a = (BitmapContainer)ca.ToBitmap();
if (cb is BitmapContainer)
b = (BitmapContainer)cb;
else if (cb is OffsetContainer)
b = (BitmapContainer)cb.ToBitmap();
else
b = (BitmapContainer)cb.ToBitmap();
var av = a.Values();
var bv = b.Values();
var la = av != null ? av.Length : 1024;
var lb = bv != null ? bv.Length : 1024;
var min = la;
if (lb < min)
min = lb;
List<ulong> vals = new List<ulong>();
for (int i = 0; i < min; i++)
{
ulong ua = ulong.MaxValue;
ulong ub = ulong.MaxValue;
if (av != null)
ua = av[i];
if (bv != null)
ub = bv[i];
vals.Add(ua & ub);
}
return new BitmapContainer(vals.ToArray());
}
private static Container containerOR(Container ca, Container cb)
{
BitmapContainer a = null;
BitmapContainer b = null;
if (ca is BitmapContainer)
a = (BitmapContainer)ca;
else if (ca is OffsetContainer)
a = (BitmapContainer)ca.ToBitmap();
else
a = (BitmapContainer)ca.ToBitmap();
if (cb is BitmapContainer)
b = (BitmapContainer)cb;
else if (cb is OffsetContainer)
b = (BitmapContainer)cb.ToBitmap();
else
b = (BitmapContainer)cb.ToBitmap();
var av = a.Values();
var bv = b.Values();
var la = av != null ? av.Length : 1024;
var lb = bv != null ? bv.Length : 1024;
var max = la;
if (lb > max)
max = lb;
List<ulong> vals = new List<ulong>();
for (int i = 0; i < max; i++)
{
ulong ua = 0;
ulong ub = 0;
if (av != null && i < la)
ua = av[i];
if (bv != null && i < lb)
ub = bv[i];
vals.Add(ua | ub);
}
return new BitmapContainer(vals.ToArray());
}
private static unsafe byte[] GetBytes(ushort num, bool reverse)
{
byte[] buffer = new byte[2];
fixed (byte* numRef = buffer)
{
*((ushort*)numRef) = num;
}
if (reverse)
Array.Reverse(buffer);
return buffer;
}
private static unsafe ulong ToULong(byte[] value, int startIndex)
{
fixed (byte* numRef = &(value[startIndex]))
{
return *(((ulong*)numRef));
}
}
private static unsafe ushort ToUShort(byte[] value, int startIndex)
{
fixed (byte* numRef = &(value[startIndex]))
{
return *(((ushort*)numRef));
}
}
private static unsafe byte[] ToByteArray(ulong[] data)
{
int arrayLength = data.Length;
byte[] byteArray = new byte[8 * arrayLength];
fixed (ulong* pointer = data)
{
fixed (byte* bytePointer = byteArray)
{
ulong* read = pointer;
ulong* write = (ulong*)bytePointer;
for (int i = 0; i < arrayLength; i++)
{
*write++ = *read++;
}
}
// below not working
//System.Runtime.InteropServices.Marshal.Copy(new IntPtr(pointer), byteArray, 0, arrayLength);
}
// not working
//fixed (ulong* src = data)
//{
// System.Runtime.InteropServices.Marshal.Copy(new IntPtr(src), byteArray, 0, arrayLength);
//}
// not working
//Buffer.BlockCopy(data, 0, byteArray, 0, arrayLength);
return byteArray;
}
private static unsafe byte[] ToByteArray(ushort[] data)
{
int arrayLength = data.Length;
byte[] byteArray = new byte[2 * arrayLength];
fixed (ushort* pointer = data)
{
fixed (byte* bytePointer = byteArray)
{
ushort* read = pointer;
ushort* write = (ushort*)bytePointer;
for (int i = 0; i < arrayLength; i++)
{
*write++ = *read++;
}
}
}
// not working
//fixed (ushort* src = data)
//{
// System.Runtime.InteropServices.Marshal.Copy(new IntPtr(src), byteArray, 0, arrayLength);
//}
// not working
//Buffer.BlockCopy(data, 0, byteArray, 0, arrayLength);
return byteArray;
}
}
}
================================================
FILE: RaptorDB/Helper/WAHBitarray2.cs
================================================
using RaptorDB.Common;
using System;
using System.Collections.Generic;
namespace RaptorDB
{
public class WAHBitArray
{
public enum TYPE
{
WAH = 1,
Bitarray = 0,
Indexes = 2
}
public WAHBitArray()
{
_state = TYPE.Indexes;
if (Global.UseLessMemoryStructures)
_offsets = new SafeSortedList<uint, bool>();
else
_offsets = new SafeDictionary<uint, bool>();
}
public WAHBitArray(TYPE type, uint[] ints)
{
_state = type;
switch (type)
{
case TYPE.WAH:
_compressed = ints;
Uncompress();
_state = TYPE.Bitarray;
_compressed = null;
break;
case TYPE.Bitarray:
_uncompressed = ints;
break;
case TYPE.Indexes:
if (Global.UseLessMemoryStructures)
_offsets = new SafeSortedList<uint, bool>();
else
_offsets = new SafeDictionary<uint, bool>();
//new Dictionary<uint, bool>();
foreach (var i in ints)
_offsets.Add(i, true);
break;
}
}
private uint[] _compressed;
private uint[] _uncompressed;
//private Dictionary<uint, bool> _offsets = new Dictionary<uint, bool>();
private IKV<uint, bool> _offsets = null;// new SafeSortedList<uint, bool>();
private uint _curMax = 0;
private TYPE _state;
public bool isDirty = false;
public WAHBitArray Copy()
{
lock (_lock)
{
uint[] i = GetBitArray();
return new WAHBitArray(TYPE.Bitarray, i);
}
}
public bool Get(int index)
{
lock (_lock)
{
if (_state == TYPE.Indexes)
{
bool b = false;
var f = _offsets.TryGetValue((uint)index, out b);
if (f)
return b;
else
return false;
}
CheckBitArray();
Resize(index);
return internalGet(index);
}
}
private object _lock = new object();
public void Set(int index, bool val)
{
lock (_lock)
{
if (_state == TYPE.Indexes)
{
isDirty = true;
if (val == true)
{
_offsets.Add((uint)index, true);
// set max
if (index > _curMax)
_curMax = (uint)index;
}
else
{
_offsets.Remove((uint)index);
}
ChangeTypeIfNeeded();
return;
}
CheckBitArray();
Resize(index);
internalSet(index, val);
}
}
public int Length
{
set
{
lock (_lock)
{
if (_state == TYPE.Indexes)
{
// ignore
return;
}
CheckBitArray();
int c = value >> 5;
c++;
if (c > _uncompressed.Length)
{
uint[] ar = new uint[c];
_uncompressed.CopyTo(ar, 0);
_uncompressed = ar;
}
}
}
get
{
if (_state == TYPE.Indexes)
{
if (_offsets.Count() == 0) return 0;
uint[] k = GetOffsets();
uint l = k[k.Length - 1];
return (int)l;
}
CheckBitArray();
return _uncompressed.Length << 5;
}
}
#region [ B I T O P E R T A I O N S ]
public WAHBitArray And(WAHBitArray op)
{
lock (_lock)
{
uint[] left;
uint[] right;
prelogic(op, out left, out right);
for (int i = 0; i < left.Length; i++)
left[i] &= right[i];
return new WAHBitArray(TYPE.Bitarray, left);
}
}
public WAHBitArray AndNot(WAHBitArray op)
{
lock (_lock)
{
uint[] left;
uint[] right;
prelogic(op, out left, out right);
for (int i = 0; i < left.Length; i++)
left[i] &= ~right[i];
return new WAHBitArray(TYPE.Bitarray, left);
}
}
public WAHBitArray Or(WAHBitArray op)
{
lock (_lock)
{
uint[] left;
uint[] right;
prelogic(op, out left, out right);
for (int i = 0; i < left.Length; i++)
left[i] |= right[i];
return new WAHBitArray(TYPE.Bitarray, left);
}
}
public WAHBitArray Not(int size)
{
lock (_lock)
{
this.CheckBitArray();
uint[] left = this.GetBitArray();
int c = left.Length;
int ms = size >> 5;
if (size - (ms << 5) > 0)
ms++; // include remainder
if (ms > c)
{
var a = new uint[ms];
Array.Copy(left, 0, a, 0, c);
left = a;
c = ms;
}
for (int i = 0; i < c; i++)
left[i] = ~left[i];
return new WAHBitArray(TYPE.Bitarray, left);
}
}
public WAHBitArray Xor(WAHBitArray op)
{
lock (_lock)
{
uint[] left;
uint[] right;
prelogic(op, out left, out right);
for (int i = 0; i < left.Length; i++)
left[i] ^= right[i];
return new WAHBitArray(TYPE.Bitarray, left);
}
}
#endregion
private static int BitCount(uint n)
{ // 32-bit recursive reduction using SWAR
n -= ((n >> 1) & 0x55555555);
n = (((n >> 2) & 0x33333333) + (n & 0x33333333));
n = (((n >> 4) + n) & 0x0f0f0f0f);
return (int)((n * 0x01010101) >> 24);
}
public long CountOnes()
{
if (_state == TYPE.Indexes)
{
return _offsets.Count();
}
long c = 0;
CheckBitArray();
foreach (uint i in _uncompressed)
c += BitCount(i);
return c;
}
public long CountZeros()
{
if (_state == TYPE.Indexes)
{
long ones = _offsets.Count();
uint[] k = GetOffsets();
long l = k[k.Length - 1];
return l - ones;
}
CheckBitArray();
int count = _uncompressed.Length << 5;
long cc = CountOnes();
return count - cc;
}
public void FreeMemory()
{
if (_state == TYPE.Bitarray)
{
if (_uncompressed != null)
{
lock (_lock)
{
_compressed = Compress(_uncompressed);
_uncompressed = null;
_state = TYPE.WAH;
}
}
}
}
public uint[] GetCompressed(out TYPE type)
{
type = TYPE.WAH;
ChangeTypeIfNeeded();
if (_state == TYPE.Indexes)
{
type = TYPE.Indexes;
return GetOffsets();
}
else if (_uncompressed == null)
return new uint[] { 0 };
uint[] d = Compress(_uncompressed);
return d;
}
public IEnumerable<int> GetBitIndexes()
{
if (_state == TYPE.Indexes)
{
foreach (int i in GetOffsets())
yield return i;
}
else
{
CheckBitArray();
int count = _uncompressed.Length;
for (int i = 0; i < count; i++)
{
if (_uncompressed[i] > 0)
{
for (int j = 0; j < 32; j++)
{
bool b = internalGet((i << 5) + j);
if (b == true)// ones)
yield return (i << 5) + j;
}
}
}
}
}
#region [ P R I V A T E ]
private uint[] GetOffsets()
{
uint[] k;
lock (_lock)
{
k = new uint[_offsets.Count()];
_offsets.Keys().CopyTo(k, 0);
}
Array.Sort(k);
return k;
}
private void prelogic(WAHBitArray op, out uint[] left, out uint[] right)
{
this.CheckBitArray();
left = this.GetBitArray();
right = op.GetBitArray();
int ic = left.Length;
int uc = right.Length;
if (ic > uc)
{
uint[] ar = new uint[ic];
right.CopyTo(ar, 0);
right = ar;
}
else if (ic < uc)
{
uint[] ar = new uint[uc];
left.CopyTo(ar, 0);
left = ar;
}
}
internal uint[] GetBitArray()
{
lock (_lock)
{
if (_state == TYPE.Indexes)
return UnpackOffsets();
this.CheckBitArray();
uint[] ui = new uint[_uncompressed.Length];
_uncompressed.CopyTo(ui, 0);
return ui;
}
}
private uint[] UnpackOffsets()
{
// return bitmap uints
uint max = 0;
if (_offsets.Count() == 0) return new uint[0];
uint[] k = GetOffsets();
max = k[k.Length - 1];
uint[] ints = new uint[(max >> 5) + 1];
foreach (int index in k)
{
int pointer = ((int)index) >> 5;
uint mask = (uint)1 << (31 - // high order bit set
((int)index % 32));
ints[pointer] |= mask;
}
return ints;
}
private void ChangeTypeIfNeeded()
{
if (_state != TYPE.Indexes)
return;
uint T = (_curMax >> 5) + 1;
int c = _offsets.Count();
if (c > T && c > Global.BitmapOffsetSwitchOverCount)
{
// change type to WAH
_state = TYPE.Bitarray;
_uncompressed = new uint[0];
// create bitmap
foreach (var i in _offsets.Keys())
Set((int)i, true);
// clear list
if (Global.UseLessMemoryStructures)
_offsets = new SafeSortedList<uint, bool>();
else
_offsets = new SafeDictionary<uint, bool>();
//new Dictionary<uint, bool>();
}
}
private void Resize(int index)
{
if (_state == TYPE.Indexes)
return;
int c = index >> 5;
c++;
if (_uncompressed == null)
{
_uncompressed = new uint[c];
return;
}
if (c > _uncompressed.Length)
{
uint[] ar = new uint[c];
_uncompressed.CopyTo(ar, 0);
_uncompressed = ar;
}
}
private static void ResizeAsNeeded(List<uint> list, int index)
{
int count = index >> 5;
while (list.Count < count)
list.Add(0);
}
private void internalSet(int index, bool val)
{
isDirty = true;
int pointer = index >> 5;
uint mask = (uint)1 << (31 - // high order bit set
(index % 32));
if (val)
_uncompressed[pointer] |= mask;
else
_uncompressed[pointer] &= ~mask;
}
private bool internalGet(int index)
{
int pointer = index >> 5;
uint mask = (uint)1 << (31 - // high order bit get
(index % 32));
if (pointer < _uncompressed.Length)
return (_uncompressed[pointer] & mask) != 0;
else
return false;
}
private void CheckBitArray()
{
if (_state == TYPE.Bitarray)
return;
if (_state == TYPE.WAH)
{
_uncompressed = new uint[0];
Uncompress();
_state = TYPE.Bitarray;
_compressed = null;
return;
}
}
#region compress / uncompress
private static uint Take31Bits(uint[] data, int index)
{
ulong l1 = 0;
ulong l2 = 0;
ulong l = 0;
ulong ret = 0;
int off = (index % 32);
int pointer = index >> 5;
l1 = data[pointer];
pointer++;
if (pointer < data.Length)
l2 = data[pointer];
l = (l1 << 32) + l2;
ret = (l >> (33 - off)) & 0x7fffffff;
return (uint)ret;
}
private static uint[] Compress(uint[] data)
{
List<uint> compressed = new List<uint>();
uint zeros = 0;
uint ones = 0;
int count = data.Length << 5;
int i = 0;
while (i < count)//for (int i = 0; i < count;)
{
uint num = Take31Bits(data, i);
i += 31;
if (num == 0) // all zero
{
zeros += 31;
FlushOnes(compressed, ref ones);
}
else if (num == 0x7fffffff) // all ones
{
ones += 31;
FlushZeros(compressed, ref zeros);
}
else // literal
{
FlushOnes(compressed, ref ones);
FlushZeros(compressed, ref zeros);
compressed.Add(num);
}
}
FlushOnes(compressed, ref ones);
FlushZeros(compressed, ref zeros);
return compressed.ToArray();
}
private static void FlushOnes(List<uint> compressed, ref uint ones)
{
if (ones > 0)
{
uint n = 0xc0000000 + ones;
ones = 0;
compressed.Add(n);
}
}
private static void FlushZeros(List<uint> compressed, ref uint zeros)
{
if (zeros > 0)
{
uint n = 0x80000000 + zeros;
zeros = 0;
compressed.Add(n);
}
}
private static void Write31Bits(List<uint> list, int index, uint val)
{
ResizeAsNeeded(list, index + 32);
int off = (index % 32);
int pointer = index >> 5;
if (pointer >= list.Count - 1)
list.Add(0);
ulong l = ((ulong)list[pointer] << 32) + list[pointer + 1];
l |= (ulong)val << (33 - off);
list[pointer] = (uint)(l >> 32);
list[pointer + 1] = (uint)(l & 0xffffffff);
}
private void WriteOnes(List<uint> list, int index, uint count)
{
ResizeAsNeeded(list, index);
int off = index % 32;
int pointer = index >> 5;
int ccount = (int)count;
int indx = index;
int x = 32 - off;
if (pointer >= list.Count)
list.Add(0);
if (ccount > x)//|| x == 32) //current pointer
{
list[pointer] |= (uint)((0xffffffff >> off));
ccount -= x;
indx += x;
}
else
{
list[pointer] |= (uint)((0xffffffff << (32 - ccount)) >> off);
ccount = 0;
}
bool checklast = true;
while (ccount >= 32)//full ints
{
if (checklast && list[list.Count - 1] == 0)
{
list.RemoveAt(list.Count - 1);
checklast = false;
}
list.Add(0xffffffff);
ccount -= 32;
indx += 32;
}
int p = indx >> 5;
off = indx % 32;
if (ccount > 0)
{
uint i = 0xffffffff << (32 - ccount);
if (p > (list.Count - 1)) //remaining
list.Add(i);
else
list[p] |= (uint)(i >> off);
}
}
private void Uncompress()
{
int index = 0;
List<uint> list = new List<uint>();
if (_compressed == null)
return;
foreach (uint ci in _compressed)
{
if ((ci & 0x80000000) == 0) // literal
{
Write31Bits(list, index, ci);
index += 31;
}
else
{
uint count = ci & 0x3fffffff;
if ((ci & 0x40000000) != 0) // ones count
WriteOnes(list, index, count);
index += (int)count;
}
}
ResizeAsNeeded(list, index);
_uncompressed = list.ToArray();
}
#endregion
#endregion
internal static WAHBitArray Fill(int count)
{
if (count > 0)
{
int c = count >> 5;
int r = count % 32;
if (r > 0)
c++;
uint[] ints = new uint[c];
for (int i = 0; i < c; i++)
ints[i] = 0xffffffff;
if (r > 0)
ints[c - 1] = 0xffffffff << (31 - r);
return new WAHBitArray(TYPE.Bitarray, ints);
}
return new WAHBitArray();
}
internal int GetFirst()
{
foreach (var i in GetBitIndexes())
return i;
return 0;
}
}
}
================================================
FILE: RaptorDB/Indexes/BitmapIndex.cs
================================================
using RaptorDB.Common;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
namespace RaptorDB
{
internal class BitmapIndex
{
public BitmapIndex(string path, string filename)
{
if (Global.UseLessMemoryStructures)
_cache = new SafeSortedList<int, MGRB>();
else
_cache = new SafeDictionary<int, MGRB>();
_FileName = Path.GetFileNameWithoutExtension(filename);
_Path = path;
if (_Path.EndsWith(Path.DirectorySeparatorChar.ToString()) == false)
_Path += Path.DirectorySeparatorChar.ToString();
Initialize();
}
class L : IDisposable
{
BitmapIndex _sc;
public L(BitmapIndex sc)
{
_sc = sc;
_sc.CheckInternalOP();
}
void IDisposable.Dispose()
{
_sc.Done();
}
}
private string _recExt = ".mgbmr";
private string _bmpExt = ".mgbmp";
private string _FileName = "";
private string _Path = "";
private FileStream _bitmapFileWriteOrg;
private BufferedStream _bitmapFileWrite;
private FileStream _bitmapFileRead;
private FileStream _recordFileRead;
private FileStream _recordFileWriteOrg;
private BufferedStream _recordFileWrite;
private long _lastBitmapOffset = 0;
private int _lastRecordNumber = 0;
//private SafeDictionary<int, MGRB> _cache = new SafeDictionary<int, MGRB>();
private IKV<int, MGRB> _cache = null;// new SafeSortedList<int, MGRB>();
private ILog log = LogManager.GetLogger(typeof(BitmapIndex));
private bool _stopOperations = false;
private bool _shutdownDone = false;
private int _workingCount = 0;
private bool _isDirty = false;
#region
public void Shutdown()
{
using (new L(this))
{
log.Debug("Shutdown BitmapIndex");
InternalShutdown();
}
}
public int GetFreeRecordNumber()
{
using (new L(this))
{
int i = _lastRecordNumber++;
_cache.Add(i, new MGRB());
return i;
}
}
public void Commit(bool freeMemory)
{
if (_isDirty == false)
return;
using (new L(this))
{
log.Debug("writing " + _FileName);
int[] keys = _cache.Keys();
Array.Sort(keys);
foreach (int k in keys)
{
MGRB bmp = null;
if (_cache.TryGetValue(k, out bmp) && bmp.isDirty)
{
bmp.Optimize();
SaveBitmap(k, bmp);
bmp.isDirty = false;
}
}
Flush();
if (freeMemory)
{
if (Global.UseLessMemoryStructures)
_cache = new SafeSortedList<int, MGRB>();
else
_cache = new SafeDictionary<int, MGRB>();
log.Debug(" freeing cache");
}
_isDirty = false;
}
}
public void SetDuplicate(int bitmaprecno, int record)
{
using (new L(this))
{
MGRB ba = null;
ba = internalGetBitmap(bitmaprecno); //GetBitmap(bitmaprecno);
ba.Set(record, true);
_isDirty = true;
}
}
public MGRB GetBitmap(int recno)
{
using (new L(this))
{
return internalGetBitmap(recno);
}
}
private object _oplock = new object();
public void Optimize()
{
lock (_oplock)
lock (_readlock)
lock (_writelock)
{
_stopOperations = true;
while (_workingCount > 0) Thread.SpinWait(1);
Flush();
if (File.Exists(_Path + _FileName + "$" + _bmpExt))
File.Delete(_Path + _FileName + "$" + _bmpExt);
if (File.Exists(_Path + _FileName + "$" + _recExt))
File.Delete(_Path + _FileName + "$" + _recExt);
Stream _newrec = new FileStream(_Path + _FileName + "$" + _recExt, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
Stream _newbmp = new FileStream(_Path + _FileName + "$" + _bmpExt, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
long newoffset = 0;
int c = (int)(_recordFileRead.Length / 8);
for (int i = 0; i < c; i++)
{
long offset = ReadRecordOffset(i);
byte[] b = ReadBMPDataForOptimize(offset);
if (b == null)
{
_stopOperations = false;
throw new Exception("bitmap index file is corrupted");
}
_newrec.Write(Helper.GetBytes(newoffset, false), 0, 8);
newoffset += b.Length;
_newbmp.Write(b, 0, b.Length);
}
_newbmp.Flush();
_newbmp.Close();
_newrec.Flush();
_newrec.Close();
InternalShutdown();
File.Delete(_Path + _FileName + _bmpExt);
File.Delete(_Path + _FileName + _recExt);
File.Move(_Path + _FileName + "$" + _bmpExt, _Path + _FileName + _bmpExt);
File.Move(_Path + _FileName + "$" + _recExt, _Path + _FileName + _recExt);
Initialize();
_stopOperations = false;
}
}
internal void FreeMemory()
{
try
{
List<int> free = new List<int>();
foreach (var k in _cache.Keys())
{
var val = _cache.GetValue(k);
if (val.isDirty == false)
free.Add(k);
}
log.Info("releasing bmp count = " + free.Count + " out of " + _cache.Count());
foreach (int i in free)
_cache.Remove(i);
}
catch (Exception ex)
{
log.Error(ex);
}
}
#endregion
#region [ P R I V A T E ]
private long ReadRecordOffset(int recnum)
{
byte[] b = new byte[8];
long off = ((long)recnum) * 8;
_recordFileRead.Seek(off, SeekOrigin.Begin);
_recordFileRead.Read(b, 0, 8);
return Helper.ToInt64(b, 0);
}
private void Initialize()
{
_recordFileRead = new FileStream(_Path + _FileName + _recExt, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
_recordFileWriteOrg = new FileStream(_Path + _FileName + _recExt, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
_recordFileWrite = new BufferedStream(_recordFileWriteOrg);
_bitmapFileRead = new FileStream(_Path + _FileName + _bmpExt, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
_bitmapFileWriteOrg = new FileStream(_Path + _FileName + _bmpExt, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
_bitmapFileWrite = new BufferedStream(_bitmapFileWriteOrg);
_bitmapFileWrite.Seek(0L, SeekOrigin.End);
_lastBitmapOffset = _bitmapFileWrite.Length;
_lastRecordNumber = (int)(_recordFileRead.Length / 8);
_shutdownDone = false;
}
private void InternalShutdown()
{
bool d1 = false;
bool d2 = false;
if (_shutdownDone == false)
{
Flush();
if (_recordFileWrite.Length == 0) d1 = true;
if (_bitmapFileWrite.Length == 0) d2 = true;
_recordFileRead.Close();
_bitmapFileRead.Close();
_bitmapFileWriteOrg.Close();
_recordFileWriteOrg.Close();
_recordFileWrite.Close();
_bitmapFileWrite.Close();
if (d1)
File.Delete(_Path + _FileName + _recExt);
if (d2)
File.Delete(_Path + _FileName + _bmpExt);
_recordFileWrite = null;
_recordFileRead = null;
_bitmapFileRead = null;
_bitmapFileWrite = null;
_recordFileRead = null;
_recordFileWrite = null;
_shutdownDone = true;
}
}
private void Flush()
{
if (_shutdownDone)
return;
if (_recordFileWrite != null)
_recordFileWrite.Flush();
if (_bitmapFileWrite != null)
_bitmapFileWrite.Flush();
if (_recordFileRead != null)
_recordFileRead.Flush();
if (_bitmapFileRead != null)
_bitmapFileRead.Flush();
if (_bitmapFileWriteOrg != null)
_bitmapFileWriteOrg.Flush();
if (_recordFileWriteOrg != null)
_recordFileWriteOrg.Flush();
}
private object _readlock = new object();
private MGRB internalGetBitmap(int recno)
{
lock (_readlock)
{
MGRB ba = new MGRB();
if (recno == -1)
return ba;
if (_cache.TryGetValue(recno, out ba))
{
return ba;
}
else
{
long offset = 0;
//if (_offsetCache.TryGetValue(recno, out offset) == false)
{
offset = ReadRecordOffset(recno);
// _offsetCache.Add(recno, offset);
}
ba = LoadBitmap(offset);
_cache.Add(recno, ba);
return ba;
}
}
}
private object _writelock = new object();
private void SaveBitmap(int recno, MGRB bmp)
{
lock (_writelock)
{
long offset = SaveBitmapToFile(bmp);
//long v;
//if (_offsetCache.TryGetValue(recno, out v))
// _offsetCache[recno] = offset;
//else
// _offsetCache.Add(recno, offset);
long pointer = ((long)recno) * 8;
_recordFileWrite.Seek(pointer, SeekOrigin.Begin);
byte[] b = new byte[8];
b = Helper.GetBytes(offset, false);
_recordFileWrite.Write(b, 0, 8);
}
}
//-----------------------------------------------------------------
// new format
// 0 : b
// 1 : m
// 2 : type 0 = uncompressed, 1 = compressed
// 3 : data size (int)
// 8 : data bytes
private byte _hdrlen = 2 + 4 + 1;
private long SaveBitmapToFile(MGRB bmp)
{
long off = _lastBitmapOffset;
var dat = bmp.Serialize();
var hdr = new byte[_hdrlen];
var b = fastBinaryJSON.BJSON.ToBJSON(dat, new fastBinaryJSON.BJSONParameters { UseExtensions = false });
hdr[0] = (byte)'b';
hdr[1] = (byte)'m';
hdr[2] = 0; // uncompressed
if (Global.CompressBitmapBytes)
{
hdr[2] = 1;
b = MiniLZO.Compress(b);
}
var s = Helper.GetBytes(b.Length, false);
Buffer.BlockCopy(s, 0, hdr, 3, 4);
_bitmapFileWrite.Write(hdr, 0, hdr.Length);
_lastBitmapOffset += hdr.Length;
_bitmapFileWrite.Write(b, 0, b.Length);
_lastBitmapOffset += b.Length;
return off;
}
private byte[] ReadBMPDataForOptimize(long offset)
{
// return data + header
_bitmapFileRead.Seek(offset, SeekOrigin.Begin);
byte[] hdr = new byte[_hdrlen];
_bitmapFileRead.Read(hdr, 0, _hdrlen);
if (hdr[0] == (byte)'b' && hdr[1] == (byte)'m')
{
int c = Helper.ToInt32(hdr, 3);
var data = new byte[c + _hdrlen];
Buffer.BlockCopy(hdr, 0, data, 0, _hdrlen);
_bitmapFileRead.Read(data, _hdrlen, c);
return data;
}
return null;
}
private MGRB LoadBitmap(long offset)
{
MGRB bc = new MGRB();
if (offset == -1)
return bc;
FileStream bmp = _bitmapFileRead;
bmp.Seek(offset, SeekOrigin.Begin);
var hdr = new byte[_hdrlen];
bmp.Read(hdr, 0, hdr.Length);
if (hdr[0] == (byte)'b' && hdr[1] == (byte)'m')
{
int c = Helper.ToInt32(hdr, 3);
var b = new byte[c];
bmp.Read(b, 0, c);
if (hdr[2] == 1)
b = MiniLZO.Decompress(b);
bc.Deserialize(fastBinaryJSON.BJSON.ToObject<MGRBData>(b));
}
else
log.Error("bitmap not recognized");
return bc;
}
#pragma warning disable 642
private void CheckInternalOP()
{
if (_stopOperations)
lock (_oplock) { } // yes! this is good
Interlocked.Increment(ref _workingCount);
}
#pragma warning restore 642
private void Done()
{
Interlocked.Decrement(ref _workingCount);
}
#endregion
}
}
================================================
FILE: RaptorDB/Indexes/Cache.cs
================================================
using System;
using System.Xml.Serialization;
namespace RaptorDB
{
public enum OPERATION
{
AND,
OR,
ANDNOT
}
public class Document
{
public string FullName;
public DateTime Created;
public DateTime Modified;
public long Length;
public string Extension;
public Document()
{
DocNumber = -1;
}
public Document(string filename, string text)
{
FileName = filename;
Text = text;
DocNumber = -1;
}
public int DocNumber { get; set; }
[XmlIgnore]
public string Text { get; set; }
public string FileName { get; set; }
public string Abstract { get; set; }
public override string ToString()
{
return FileName;
}
}
}
================================================
FILE: RaptorDB/Indexes/Hoot.cs
================================================
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
using RaptorDB.Common;
namespace RaptorDB
{
public class Hoot
{
public Hoot(string IndexPath, string FileName, bool DocMode) : this(IndexPath, FileName, DocMode, new tokenizer())
{
}
public Hoot(string IndexPath, string FileName, bool DocMode, ITokenizer tokenizer)
{
if (tokenizer != null)
_tokenizer = tokenizer;
else
_tokenizer = new tokenizer();
_Path = IndexPath;
_FileName = FileName;
_docMode = DocMode;
if (_Path.EndsWith(Path.DirectorySeparatorChar.ToString()) == false) _Path += Path.DirectorySeparatorChar;
Directory.CreateDirectory(IndexPath);
_log.Debug("Starting hOOt....");
_log.Debug("Storage Folder = " + _Path);
if (DocMode)
{
_docs = new KeyStoreString(_Path + "files.docs", false);
// read deleted
_deleted = new BoolIndex(_Path, "_deleted", ".hoot");
_lastDocNum = (int)_docs.Count();
}
_bitmaps = new BitmapIndex(_Path, _FileName + "_hoot.bmp");
// read words
LoadWords();
}
private ITokenizer _tokenizer;
private SafeDictionary<string, int> _words = new SafeDictionary<string, int>();
//private SafeSortedList<string, int> _words = new SafeSortedList<string, int>();
private BitmapIndex _bitmaps;
private BoolIndex _deleted;
private ILog _log = LogManager.GetLogger(typeof(Hoot));
private int _lastDocNum = 0;
private string _FileName = "words";
private string _Path = "";
private KeyStoreString _docs;
private bool _docMode = false;
private bool _wordschanged = true;
private bool _shutdowndone = false;
private object _lock = new object();
public string[] Words
{
get { checkloaded(); return _words.Keys(); }
}
public int WordCount
{
get { checkloaded(); return _words.Count(); }
}
public int DocumentCount
{
get { checkloaded(); return _lastDocNum - (int)_deleted.GetBits().CountOnes(); }
}
public string IndexPath { get { return _Path; } }
public void Save()
{
lock (_lock)
InternalSave();
}
public void Index(int recordnumber, string text)
{
checkloaded();
AddtoIndex(recordnumber, text);
}
public MGRB Query(string filter, int maxsize)
{
checkloaded();
return ExecutionPlan(filter, maxsize);
}
public int Index(Document doc, bool deleteold)
{
checkloaded();
_log.Info("indexing doc : " + doc.FileName);
DateTime dt = FastDateTime.Now;
if (deleteold && doc.DocNumber > -1)
_deleted.Set(true, doc.DocNumber);
if (deleteold == true || doc.DocNumber == -1)
doc.DocNumber = _lastDocNum++;
// save doc to disk
string dstr = fastJSON.JSON.ToJSON(doc, new fastJSON.JSONParameters { UseExtensions = false });
_docs.Set(doc.FileName.ToLower(), fastJSON.Reflection.UnicodeGetBytes(dstr));
_log.Info("writing doc to disk (ms) = " + FastDateTime.Now.Subtract(dt).TotalMilliseconds);
dt = FastDateTime.Now;
// index doc
AddtoIndex(doc.DocNumber, doc.Text);
_log.Info("indexing time (ms) = " + FastDateTime.Now.Subtract(dt).TotalMilliseconds);
return _lastDocNum;
}
public IEnumerable<int> FindRows(string filter)
{
checkloaded();
MGRB bits = ExecutionPlan(filter, _docs.RecordCount());
// enumerate records
return bits.GetBitIndexes();
}
public IEnumerable<T> FindDocuments<T>(string filter)
{
checkloaded();
MGRB bits = ExecutionPlan(filter, _docs.RecordCount());
// enumerate documents
foreach (int i in bits.GetBitIndexes())
{
if (i > _lastDocNum - 1)
break;
string b = _docs.ReadData(i);
T d = fastJSON.JSON.ToObject<T>(b, new fastJSON.JSONParameters { ParametricConstructorOverride = true });
yield return d;
}
}
public IEnumerable<string> FindDocumentFileNames(string filter)
{
checkloaded();
MGRB bits = ExecutionPlan(filter, _docs.RecordCount());
// enumerate documents
foreach (int i in bits.GetBitIndexes())
{
if (i > _lastDocNum - 1)
break;
string b = _docs.ReadData(i);
var d = (Dictionary<string, object>)fastJSON.JSON.Parse(b);
yield return d["FileName"].ToString();
}
}
public void RemoveDocument(int number)
{
// add number to deleted bitmap
_deleted.Set(true, number);
}
public bool RemoveDocument(string filename)
{
// remove doc based on filename
byte[] b;
if (_docs.Get(filename.ToLower(), out b))
{
Document d = fastJSON.JSON.ToObject<Document>(fastJSON.Reflection.UnicodeGetString(b));
RemoveDocument(d.DocNumber);
return true;
}
return false;
}
public bool IsIndexed(string filename)
{
byte[] b;
return _docs.Get(filename.ToLower(), out b);
}
public void OptimizeIndex()
{
lock (_lock)
{
InternalSave();
//_bitmaps.Commit(false);
_bitmaps.Optimize();
}
}
#region [ P R I V A T E M E T H O D S ]
private void checkloaded()
{
if (_wordschanged == false)
{
LoadWords();
}
}
private MGRB ExecutionPlan(string filter, int maxsize)
{
//_log.Debug("query : " + filter);
DateTime dt = FastDateTime.Now;
// query indexes
string[] words = filter.Split(' ');
//bool defaulttoand = true;
//if (filter.IndexOfAny(new char[] { '+', '-' }, 0) > 0)
// defaulttoand = false;
MGRB found = null;// MGRB.Fill(maxsize);
foreach (string s in words)
{
int c;
bool not = false;
string word = s;
if (s == "") continue;
OPERATION op = OPERATION.AND;
//if (defaulttoand)
// op = OPERATION.AND;
if (word.StartsWith("+"))
{
op = OPERATION.OR;
word = s.Replace("+", "");
}
if (word.StartsWith("-"))
{
op = OPERATION.ANDNOT;
word = s.Replace("-", "");
not = true;
if (found == null) // leading with - -> "-oak hill"
{
found = MGRB.Fill(maxsize);
}
}
if (word.Contains("*") || word.Contains("?"))
{
MGRB wildbits = new MGRB();
// do wildcard search
Regex reg = new Regex("^" + word.Replace("*", ".*").Replace("?", ".") + "$", RegexOptions.IgnoreCase);
foreach (string key in _words.Keys())
{
if (reg.IsMatch(key))
{
_words.TryGetValue(key, out c);
MGRB ba = _bitmaps.GetBitmap(c);
wildbits = DoBitOperation(wildbits, ba, OPERATION.OR, maxsize);
}
}
if (found == null)
found = wildbits;
else
{
if (not) // "-oak -*l"
found = found.AndNot(wildbits);
else if (op == OPERATION.AND)
found = found.And(wildbits);
else
found = found.Or(wildbits);
}
}
else if (_words.TryGetValue(word.ToLowerInvariant(), out c))
{
// bits logic
MGRB ba = _bitmaps.GetBitmap(c);
found = DoBitOperation(found, ba, op, maxsize);
}
else if (op == OPERATION.AND)
found = new MGRB();
}
if (found == null)
return new MGRB();
// remove deleted docs
MGRB ret;
if (_docMode)
ret = found.AndNot(_deleted.GetBits());
else
ret = found;
//_log.Debug("query time (ms) = " + FastDateTime.Now.Subtract(dt).TotalMilliseconds);
return ret;
}
private static MGRB DoBitOperation(MGRB bits, MGRB c, OPERATION op, int maxsize)
{
if (bits != null)
{
switch (op)
{
case OPERATION.AND:
bits = bits.And(c);
break;
case OPERATION.OR:
bits = bits.Or(c);
break;
case OPERATION.ANDNOT:
bits = bits.And(c.Not(maxsize));
break;
}
}
else
bits = c;
return bits;
}
private void InternalSave()
{
_log.Info("saving index...");
DateTime dt = FastDateTime.Now;
// save deleted
if (_deleted != null)
_deleted.SaveIndex();
// save docs
if (_docMode)
_docs.SaveIndex();
if (_bitmaps != null)
_bitmaps.Commit(true);
if (_words != null && _wordschanged == true)
{
// save words and bitmaps
using (FileStream words = new FileStream(_Path + _FileName + ".words", FileMode.Create))
{
using (BinaryWriter bw = new BinaryWriter(words, Encoding.UTF8))
{
foreach (string key in _words.Keys())
{
bw.Write(key);
bw.Write(_words[key]);
}
}
}
_wordschanged = false;
}
_log.Info("save time (ms) = " + FastDateTime.Now.Subtract(dt).TotalMilliseconds);
}
private void LoadWords()
{
lock (_lock)
{
if (_words == null)
_words = new SafeDictionary<string, int>();
// new SafeSortedList<string, int>();
if (File.Exists(_Path + _FileName + ".words") == false)
return;
// load words
using (FileStream words = new FileStream(_Path + _FileName + ".words", FileMode.Open))
{
if (words.Length == 0)
return;
using (BinaryReader br = new BinaryReader(words, Encoding.UTF8))
{
string s = br.ReadString();
while (s != "")
{
int off = br.ReadInt32();
_words.Add(s, off);
try
{
s = br.ReadString();
}
catch { s = ""; }
}
}
}
//byte[] b = File.ReadAllBytes(_Path + _FileName + ".words");
//if (b.Length == 0)
// return;
//MemoryStream ms = new MemoryStream(b);
//BinaryReader br = new BinaryReader(ms, Encoding.UTF8);
//string s = br.ReadString();
//while (s != "")
//{
// int off = br.ReadInt32();
// _words.Add(s, off);
// try
// {
// s = br.ReadString();
// }
// catch { s = ""; }
//}
_log.Debug("Word Count = " + _words.Count());
_wordschanged = true;
}
}
private void AddtoIndex(int recnum, string text)
{
if (text == "" || text == null)
return;
text = text.ToLowerInvariant(); // lowercase index
string[] keys;
if (_docMode)
{
//_log.Debug("text size = " + text.Length);
Dictionary<string, int> wordfreq = _tokenizer.GenerateWordFreq(text);
//_log.Debug("word count = " + wordfreq.Count);
var kk = wordfreq.Keys;
keys = new string[kk.Count];
kk.CopyTo(keys, 0);
}
else
{
keys = text.Split(' ');
}
foreach (string key in keys)
{
if (key == "")
continue;
int bmp;
if (_words.TryGetValue(key, out bmp))
{
_bitmaps.GetBitmap(bmp).Set(recnum, true);
}
else
{
bmp = _bitmaps.GetFreeRecordNumber();
_bitmaps.SetDuplicate(bmp, recnum);
_words.Add(key, bmp);
}
}
_wordschanged = true;
}
#endregion
public void Shutdown()
{
lock (_lock)
{
if (_shutdowndone == true)
return;
InternalSave();
if (_deleted != null)
{
_deleted.SaveIndex();
_deleted.Shutdown();
_deleted = null;
}
if (_bitmaps != null)
{
_bitmaps.Commit(Global.FreeBitmapMemoryOnSave);
_bitmaps.Shutdown();
_bitmaps = null;
}
if (_docMode)
_docs.Shutdown();
_shutdowndone = true;
}
}
public void FreeMemory()
{
lock (_lock)
{
InternalSave();
if (_deleted != null)
_deleted.FreeMemory();
if (_bitmaps != null)
_bitmaps.FreeMemory();
if (_docs != null)
_docs.FreeMemory();
//_words = null;// new SafeSortedList<string, int>();
//_loaded = false;
}
}
public T Fetch<T>(int docnum)
{
string b = _docs.ReadData(docnum);
return fastJSON.JSON.ToObject<T>(b);
}
}
}
================================================
FILE: RaptorDB/Indexes/IIndex.cs
================================================
namespace RaptorDB
{
internal enum RDBExpression
{
Equal,
Greater,
GreaterEqual,
Less,
LessEqual,
NotEqual,
Between,
Contains
}
internal interface IIndex
{
void Set(object key, int recnum);
MGRB Query(object fromkey, object tokey, int maxsize);
MGRB Query(RDBExpression ex, object from , int maxsize);
void FreeMemory();
void Shutdown();
void SaveIndex();
object[] GetKeys();
}
}
================================================
FILE: RaptorDB/Indexes/ITokenizer.cs
================================================
using System.Collections.Generic;
namespace RaptorDB
{
public interface ITokenizer
{
Dictionary<string, int> GenerateWordFreq(string text);
}
}
================================================
FILE: RaptorDB/Indexes/IndexFile.cs
================================================
using System;
using System.Collections.Generic;
using System.IO;
using RaptorDB.Common;
using System.Threading;
using fastBinaryJSON;
namespace RaptorDB
{
internal class IndexFile<T>
{
FileStream _file = null;
private byte[] _FileHeader = new byte[] {
(byte)'M', (byte)'G', (byte)'I',
0, // 3 = [keysize] max 255
0,0, // 4 = [node size] max 65536
0,0,0,0, // 6 = [root page num]
0, // 10 = Index file type : 0=mgindex 1=mgindex+strings (key = firstallocblock)
0,0,0,0 // 11 = last record number indexed
};
private byte[] _BlockHeader = new byte[] {
(byte)'P',(byte)'A',(byte)'G',(byte)'E',
0, // 4 = [Flag] = 0=page 1=page list
0,0, // 5 = [item count]
0,0,0,0, // 7 = reserved
0,0,0,0 // 11 = [right page number] / [next page number]
};
internal byte _maxKeySize;
internal ushort _PageNodeCount = 5000;
private int _LastPageNumber = 1; // 0 = page list
private int _PageLength;
private int _rowSize;
private bool _allowDups = true;
ILog log = LogManager.GetLogger(typeof(IndexFile<T>));
private BitmapIndex _bitmap;
IGetBytes<T> _T = null;
private object _fileLock = new object();
private StringHF _strings;
private bool _externalStrings = false;
//private List<int> _pagelistalllocblock = null;
private string _FileName = "";
public IndexFile(string filename, byte maxKeySize)//, ushort pageNodeCount)
{
_T = RDBDataType<T>.ByteHandler();
if (typeof(T) == typeof(string) && Global.EnableOptimizedStringIndex)
{
_externalStrings = true;
_maxKeySize = 4;// blocknum:int
}
else
_maxKeySize = maxKeySize;
_PageNodeCount = Global.PageItemCount;// pageNodeCount;
_rowSize = (_maxKeySize + 1 + 4 + 4);
_FileName = filename.Substring(0, filename.LastIndexOf('.'));
string path = Path.GetDirectoryName(filename);
Directory.CreateDirectory(path);
if (File.Exists(filename))
{
// if file exists open and read header
_file = File.Open(filename, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
ReadFileHeader();
if (_externalStrings == false)// if the file says different
{
_rowSize = (_maxKeySize + 1 + 4 + 4);
}
// compute last page number from file length
_PageLength = (_BlockHeader.Length + _rowSize * (_PageNodeCount));
_LastPageNumber = (int)((_file.Length - _FileHeader.Length) / _PageLength);
}
else
{
// else create new file
_file = File.Open(filename, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
_PageLength = (_BlockHeader.Length + _rowSize * (_PageNodeCount));
CreateFileHeader(0);
_LastPageNumber = (int)((_file.Length - _FileHeader.Length) / _PageLength);
}
if (_externalStrings)
{
_strings = new StringHF(path, Path.GetFileNameWithoutExtension(filename) + ".strings");
}
if (_LastPageNumber == 0)
_LastPageNumber = 1;
// bitmap duplicates
if (_allowDups)
_bitmap = new BitmapIndex(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename));
}
#region [ C o m m o n ]
public void SetBitmapDuplicate(int bitmaprec, int rec)
{
_bitmap.SetDuplicate(bitmaprec, rec);
}
public int GetBitmapDuplaicateFreeRecordNumber()
{
return _bitmap.GetFreeRecordNumber();
}
public IEnumerable<int> GetDuplicatesRecordNumbers(int recno)
{
return GetDuplicateBitmap(recno).GetBitIndexes();
}
public MGRB GetDuplicateBitmap(int recno)
{
return _bitmap.GetBitmap(recno);
}
private byte[] CreateBlockHeader(byte type, ushort itemcount, int rightpagenumber)
{
byte[] block = new byte[_BlockHeader.Length];
Array.Copy(_BlockHeader, block, block.Length);
block[4] = type;
byte[] b = Helper.GetBytes(itemcount, false);
Buffer.BlockCopy(b, 0, block, 5, 2);
b = Helper.GetBytes(rightpagenumber, false);
Buffer.BlockCopy(b, 0, block, 11, 4);
return block;
}
private void CreateFileHeader(int rowsindexed)
{
lock (_fileLock)
{
// max key size
byte[] b = Helper.GetBytes(_maxKeySize, false);
Buffer.BlockCopy(b, 0, _FileHeader, 3, 1);
// page node count
b = Helper.GetBytes(_PageNodeCount, false);
Buffer.BlockCopy(b, 0, _FileHeader, 4, 2);
b = Helper.GetBytes(rowsindexed, false);
Buffer.BlockCopy(b, 0, _FileHeader, 11, 4);
if (_externalStrings)
_FileHeader[10] = 1;
_file.Seek(0L, SeekOrigin.Begin);
_file.Write(_FileHeader, 0, _FileHeader.Length);
if (rowsindexed == 0)
{
byte[] pagezero = new byte[_PageLength];
byte[] block = CreateBlockHeader(1, 0, -1);
Buffer.BlockCopy(block, 0, pagezero, 0, block.Length);
_file.Write(pagezero, 0, _PageLength);
}
_file.Flush();
}
}
private bool ReadFileHeader()
{
_file.Seek(0L, SeekOrigin.Begin);
byte[] b = new byte[_FileHeader.Length];
_file.Read(b, 0, _FileHeader.Length);
if (b[0] == _FileHeader[0] && b[1] == _FileHeader[1] && b[2] == _FileHeader[2]) // header
{
byte maxks = b[3];
ushort nodes = (ushort)Helper.ToInt16(b, 4);
int root = Helper.ToInt32(b, 6);
_maxKeySize = maxks;
_PageNodeCount = nodes;
_FileHeader = b;
if (b[10] == 0)
_externalStrings = false;
}
return false;
}
public int GetNewPageNumber()
{
return Interlocked.Increment(ref _LastPageNumber); //_LastPageNumber++;
}
private void SeekPage(int pnum)
{
long offset = _FileHeader.Length;
offset += (long)pnum * _PageLength;
if (offset > _file.Length)
CreateBlankPages(pnum);
_file.Seek(offset, SeekOrigin.Begin);
}
private void CreateBlankPages(int pnum)
{
// create space
byte[] b = new byte[_PageLength];
_file.Seek(0L, SeekOrigin.Current);
for (int i = pnum; i < _LastPageNumber; i++)
_file.Write(b, 0, b.Length);
_file.Flush();
}
public void FreeMemory()
{
if (_allowDups)
_bitmap.FreeMemory();
}
public void Shutdown()
{
log.Debug("Shutdown IndexFile");
if (_externalStrings)
_strings.Shutdown();
if (_file != null)
{
_file.Flush();
_file.Close();
}
_file = null;
if (_allowDups)
{
_bitmap.Commit(Global.FreeBitmapMemoryOnSave);
_bitmap.Shutdown();
}
}
#endregion
#region [ P a g e s ]
public void GetPageList(List<int> PageListDiskPages, SafeSortedList<T, PageInfo> PageList, out int lastIndexedRow)
{
lastIndexedRow = Helper.ToInt32(_FileHeader, 11);
// load page list
PageListDiskPages.Add(0); // first page list
int nextpage = LoadPageListData(0, PageList);
while (nextpage != -1)
{
nextpage = LoadPageListData(nextpage, PageList);
if (nextpage != -1)
PageListDiskPages.Add(nextpage);
}
}
private int LoadPageListData(int page, SafeSortedList<T, PageInfo> PageList)
{
lock (_fileLock)
{
// load page list data
int nextpage = -1;
SeekPage(page);
byte[] b = new byte[_PageLength];
_file.Read(b, 0, _PageLength);
if (b[0] == _BlockHeader[0] && b[1] == _BlockHeader[1] && b[2] == _BlockHeader[2] && b[3] == _BlockHeader[3])
{
short count = Helper.ToInt16(b, 5);
if (count > _PageNodeCount)
throw new Exception("Count > node size");
nextpage = Helper.ToInt32(b, 11);
int index = _BlockHeader.Length;
object[] keys = null;
// TODO : needed??
//if (File.Exists(_FileName + ".pagelist"))
//{
// var bn = File.ReadAllBytes(_FileName + ".pagelist");
// int blknum = Helper.ToInt32(bn, 0);
// byte[] bb = _strings.GetData(blknum, out _pagelistalllocblock);
// keys = (object[])BJSON.ToObject(bb);
//}
for (int i = 0; i < count; i++)
{
int idx = index + _rowSize * i;
byte ks = b[idx];
T key;
if (_externalStrings == false)
key = _T.GetObject(b, idx + 1, ks);
else
{
if (keys == null)
key = _T.GetObject(b, idx + 1, ks); // do old way until better way
else
key = (T)keys[i];
}
int pagenum = Helper.ToInt32(b, idx + 1 + _maxKeySize);
// add counts
int unique = Helper.ToInt32(b, idx + 1 + _maxKeySize + 4);
// FEATURE : add dup count
PageList.Add(key, new PageInfo(pagenum, unique, 0));
}
}
else
throw new Exception("Page List header is invalid");
return nextpage;
}
}
internal void SavePage(Page<T> page)
{
lock (_fileLock)
{
int pnum = page.DiskPageNumber;
if (pnum > _LastPageNumber)
throw new Exception("should not be here: page out of bounds");
SeekPage(pnum);
byte[] pagebytes = new byte[_PageLength];
byte[] blockheader = CreateBlockHeader(0, (ushort)page.tree.Count(), page.RightPageNumber);
Buffer.BlockCopy(blockheader, 0, pagebytes, 0, blockheader.Length);
int index = blockheader.Length;
int i = 0;
byte[] b = null;
T[] keys = page.tree.Keys();
Array.Sort(keys); // sort keys on save for read performance
int blocknum = 0;
if (_externalStrings)
{
// free old blocks
if (page.allocblocks != null)
_strings.FreeBlocks(page.allocblocks);
List<int> blocks = new List<int>();
blocknum = _strings.SaveData(page.DiskPageNumber.ToString(), BJSON.ToBJSON(keys,
new BJSONParameters { UseUnicodeStrings = false, UseTypedArrays = false }), out blocks);
page.allocblocks = blocks;
}
// node children
foreach (var kp in keys)
{
var val = page.tree[kp];
int idx = index + _rowSize * i;
// key bytes
byte[] kk;
byte size;
if (_externalStrings == false)
{
kk = _T.GetBytes(kp);
size = (byte)kk.Length;
if (size > _maxKeySize)
size = _maxKeySize;
}
else
{
kk = new byte[4];
Buffer.BlockCopy(Helper.GetBytes(blocknum, false), 0, kk, 0, 4);
size = 4;
}
// key size = 1 byte
pagebytes[idx] = size;
Buffer.BlockCopy(kk, 0, pagebytes, idx + 1, pagebytes[idx]);
// offset = 4 bytes
b = Helper.GetBytes(val.RecordNumber, false);
Buffer.BlockCopy(b, 0, pagebytes, idx + 1 + _maxKeySize, b.Length);
// duplicatepage = 4 bytes
b = Helper.GetBytes(val.DuplicateBitmapNumber, false);
Buffer.BlockCopy(b, 0, pagebytes, idx + 1 + _maxKeySize + 4, b.Length);
i++;
}
_file.Write(pagebytes, 0, pagebytes.Length);
}
}
public Page<T> LoadPageFromPageNumber(int number)
{
lock (_fileLock)
{
SeekPage(number);
byte[] b = new byte[_PageLength];
_file.Read(b, 0, _PageLength);
if (b[0] == _BlockHeader[0] && b[1] == _BlockHeader[1] && b[2] == _BlockHeader[2] && b[3] == _BlockHeader[3])
{
// create node here
Page<T> page = new Page<T>();
short count = Helper.ToInt16(b, 5);
if (count > _PageNodeCount)
throw new Exception("Count > node size");
page.DiskPageNumber = number;
page.RightPageNumber = Helper.ToInt32(b, 11);
int index = _BlockHeader.Length;
object[] keys = null;
for (int i = 0; i < count; i++)
{
int idx = index + _rowSize * i;
byte ks = b[idx];
T key = default(T);
if (_externalStrings == false)
key = _T.GetObject(b, idx + 1, ks);
else
{
if (keys == null)
{
int blknum = Helper.ToInt32(b, idx + 1, false);
List<int> ablocks = new List<int>();
byte[] bb = _strings.GetData(blknum, out ablocks);
page.allocblocks = ablocks;
keys = (object[])BJSON.ToObject(bb);
}
key = (T)keys[i];
}
int offset = Helper.ToInt32(b, idx + 1 + _maxKeySize);
int duppage = Helper.ToInt32(b, idx + 1 + _maxKeySize + 4);
page.tree.Add(key, new KeyInfo(offset, duppage));
}
return page;
}
else
throw new Exception("Page read error header invalid, number = " + number);
}
}
#endregion
internal void SavePageList(SafeSortedList<T, PageInfo> _pages, List<int> diskpages)
{
lock (_fileLock)
{
T[] keys = _pages.Keys();
int blocknum = 0;
// TODO : needed??
//if (_externalStrings)
//{
// if (_pagelistalllocblock != null)
// _strings.FreeBlocks(_pagelistalllocblock);
// blocknum = _strings.SaveData("pagelist", BJSON.ToBJSON(keys,
// new BJSONParameters { UseUnicodeStrings = false, UseTypedArrays = false }));
// File.WriteAllBytes(_FileName + ".pagelist", Helper.GetBytes(blocknum, false));
//}
// save page list
int c = (_pages.Count() / Global.PageItemCount) + 1;
// allocate pages needed
while (c > diskpages.Count)
diskpages.Add(GetNewPageNumber());
byte[] page = new byte[_PageLength];
for (int i = 0; i < (diskpages.Count - 1); i++)
{
byte[] block = CreateBlockHeader(1, Global.PageItemCount, diskpages[i + 1]);
Buffer.BlockCopy(block, 0, page, 0, block.Length);
for (int j = 0; j < Global.PageItemCount; j++)
CreatePageListData(_pages, i * Global.PageItemCount, block.Length, j, page, blocknum);
SeekPage(diskpages[i]);
_file.Write(page, 0, page.Length);
}
c = _pages.Count() % Global.PageItemCount;
byte[] lastblock = CreateBlockHeader(1, (ushort)c, -1);
Buffer.BlockCopy(lastblock, 0, page, 0, lastblock.Length);
int lastoffset = (_pages.Count() / Global.PageItemCount) * Global.PageItemCount;
for (int j = 0; j < c; j++)
CreatePageListData(_pages, lastoffset, lastblock.Length, j, page, blocknum);
SeekPage(diskpages[diskpages.Count - 1]);
_file.Write(page, 0, page.Length);
}
}
private void CreatePageListData(SafeSortedList<T, PageInfo> _pages, int offset, int rowindex, int counter, byte[] page, int blocknum)
{
int idx = rowindex + _rowSize * counter;
// key bytes
byte[] kk;
byte size;
if (_externalStrings == false)
{
kk = _T.GetBytes(_pages.GetKey(counter + offset));
size = (byte)kk.Length;
if (size > _maxKeySize)
size = _maxKeySize;
}
else
{
kk = new byte[4];
Buffer.BlockCopy(Helper.GetBytes(counter + offset, false), 0, kk, 0, 4);
size = 4;
}
// key size = 1 byte
page[idx] = size;
Buffer.BlockCopy(kk, 0, page, idx + 1, page[idx]);
// offset = 4 bytes
byte[] b = Helper.GetBytes(_pages.GetValue(offset + counter).PageNumber, false);
Buffer.BlockCopy(b, 0, page, idx + 1 + _maxKeySize, b.Length);
// add counts
b = Helper.GetBytes(_pages.GetValue(offset + counter).UniqueCount, false);
Buffer.BlockCopy(b, 0, page, idx + 1 + _maxKeySize + 4, b.Length);
// FEATURE : add dup counts
}
internal void SaveLastRecordNumber(int recnum)
{
// save the last record number indexed to the header
CreateFileHeader(recnum);
}
internal void BitmapFlush()
{
if (_allowDups)
_bitmap.Commit(Global.FreeBitmapMemoryOnSave);
}
}
}
================================================
FILE: RaptorDB/Indexes/Indexes.cs
================================================
using System;
using System.Collections.Generic;
using System.IO;
namespace RaptorDB
{
#region [ TypeIndexes ]
internal class TypeIndexes<T> : MGIndex<T>, IIndex where T : IComparable<T>
{
public TypeIndexes(string path, string filename, byte keysize)
: base(path, filename + ".mgidx", keysize, true)
{
}
public void Set(object key, int recnum)
{
if (key == null) return; // FEATURE : index null values ??
base.Set((T)key, recnum);
}
public MGRB Query(RDBExpression ex, object from, int maxsize)
{
T f = default(T);
if (typeof(T).Equals(from.GetType()) == false)
f = Converter(from);
else
f = (T)from;
return base.Query(ex, f, maxsize);
}
private T Converter(object from)
{
if (typeof(T) == typeof(Guid))
{
object o = new Guid(from.ToString());
return (T)o;
}
else
return (T)Convert.ChangeType(from, typeof(T));
}
void IIndex.FreeMemory()
{
base.SaveIndex();
base.FreeMemory();
}
void IIndex.Shutdown()
{
base.Shutdown();
}
object[] IIndex.GetKeys()
{
return base.GetKeys();
}
public MGRB Query(object fromkey, object tokey, int maxsize)
{
T f = default(T);
if (typeof(T).Equals(fromkey.GetType()) == false)
f = (T)Convert.ChangeType(fromkey, typeof(T));
else
f = (T)fromkey;
T t = default(T);
if (typeof(T).Equals(tokey.GetType()) == false)
t = (T)Convert.ChangeType(tokey, typeof(T));
else
t = (T)tokey;
return base.Query(f, t, maxsize);
}
}
#endregion
#region [ BoolIndex ]
internal class BoolIndex : IIndex
{
public BoolIndex(string path, string filename, string extension)
{
// create file
_filename = filename + extension;
_path = path;
if (_path.EndsWith(Path.DirectorySeparatorChar.ToString()) == false)
_path += Path.DirectorySeparatorChar.ToString();
if (File.Exists(_path + _filename))
ReadFile();
}
private MGRB _bits = new MGRB();
private string _filename;
private string _path;
private object _lock = new object();
public MGRB GetBits()
{
return _bits.Copy();
}
public void Set(object key, int recnum)
{
lock (_lock)
if (key != null)
_bits.Set(recnum, (bool)key);
}
public MGRB Query(RDBExpression ex, object from, int maxsize)
{
lock (_lock)
{
bool b = (bool)from;
if (b)
return _bits;
else
return _bits.Not(maxsize);
}
}
public void FreeMemory()
{
lock (_lock)
{
_bits.Optimize();
SaveIndex();
}
}
public void Shutdown()
{
// shutdown
WriteFile();
}
public void SaveIndex()
{
WriteFile();
}
public void InPlaceOR(MGRB left)
{
lock (_lock)
_bits = _bits.Or(left);
}
private void WriteFile()
{
lock (_lock)
{
_bits.Optimize();
var o = _bits.Serialize();
var b = fastBinaryJSON.BJSON.ToBJSON(o, new fastBinaryJSON.BJSONParameters { UseExtensions = false });
File.WriteAllBytes(_path + _filename, b);
}
}
private void ReadFile()
{
byte[] b = File.ReadAllBytes(_path + _filename);
var o = fastBinaryJSON.BJSON.ToObject<MGRBData>(b);
_bits = new MGRB();
_bits.Deserialize(o);
}
public MGRB Query(object fromkey, object tokey, int maxsize)
{
return Query(RDBExpression.Greater, fromkey, maxsize); // range doesn't make sense here just do from
}
public object[] GetKeys()
{
return new object[] { true, false };
}
}
#endregion
#region [ FullTextIndex ]
internal class FullTextIndex : Hoot, IIndex
{
public FullTextIndex(string IndexPath, string FileName, bool docmode, bool sortable, ITokenizer tokenizer)
: base(IndexPath, FileName, docmode, tokenizer)
{
if (sortable)
{
_idx = new TypeIndexes<string>(IndexPath, FileName, Global.DefaultStringKeySize);
_sortable = true;
}
}
private bool _sortable = false;
private IIndex _idx;
public void Set(object key, int recnum)
{
base.Index(recnum, (string)key);
if (_sortable)
_idx.Set(key, recnum);
}
public MGRB Query(RDBExpression ex, object from, int maxsize)
{
return base.Query("" + from, maxsize);
}
public void SaveIndex()
{
base.Save();
if (_sortable)
_idx.SaveIndex();
}
public MGRB Query(object fromkey, object tokey, int maxsize)
{
return base.Query("" + fromkey, maxsize); // range doesn't make sense here just do from
}
public object[] GetKeys()
{
if (_sortable)
return _idx.GetKeys(); // support get keys
else
return new object[] { };
}
void IIndex.FreeMemory()
{
base.FreeMemory();
this.SaveIndex();
}
void IIndex.Shutdown()
{
this.SaveIndex();
base.Shutdown();
if (_sortable)
_idx.Shutdown();
}
}
#endregion
#region [ EnumIndex ]
internal class EnumIndex<T> : MGIndex<string>, IIndex //where T : IComparable<T>
{
public EnumIndex(string path, string filename)
: base(path, filename + ".mgidx", 30, /*Global.PageItemCount,*/ true)
{
}
public void Set(object key, int recnum)
{
if (key == null) return; // FEATURE : index null values ??
base.Set(key.ToString(), recnum);
}
public MGRB Query(RDBExpression ex, object from, int maxsize)
{
T f = default(T);
if (typeof(T).Equals(from.GetType()) == false)
f = Converter(from);
else
f = (T)from;
return base.Query(ex, f.ToString(), maxsize);
}
private T Converter(object from)
{
if (typeof(T) == typeof(Guid))
{
object o = new Guid(from.ToString());
return (T)o;
}
else
return (T)Convert.ChangeType(from, typeof(T));
}
void IIndex.FreeMemory()
{
base.SaveIndex();
base.FreeMemory();
}
void IIndex.Shutdown()
{
base.SaveIndex();
base.Shutdown();
}
public MGRB Query(object fromkey, object tokey, int maxsize)
{
T f = default(T);
if (typeof(T).Equals(fromkey.GetType()) == false)
f = (T)Convert.ChangeType(fromkey, typeof(T));
else
f = (T)fromkey;
T t = default(T);
if (typeof(T).Equals(tokey.GetType()) == false)
t = (T)Convert.ChangeType(tokey, typeof(T));
else
t = (T)tokey;
return base.Query(f.ToString(), t.ToString(), maxsize);
}
object[] IIndex.GetKeys()
{
return base.GetKeys();
}
}
#endregion
#region [ NoIndex ]
internal class NoIndex : IIndex
{
public void Set(object key, int recnum)
{
// ignore set
}
public MGRB Query(RDBExpression ex, object from, int maxsize)
{
// always return everything
return MGRB.Fill(maxsize);
}
public void FreeMemory()
{
}
public void Shutdown()
{
}
public void SaveIndex()
{
}
public object[] GetKeys()
{
return new object[] { };
}
public MGRB Query(object fromkey, object tokey, int maxsize)
{
return MGRB.Fill(maxsize); // TODO : all or none??
}
}
#endregion
}
================================================
FILE: RaptorDB/Indexes/MGIndex.cs
================================================
using System;
using System.Collections.Generic;
using System.IO;
using RaptorDB.Common;
namespace RaptorDB
{
#region [ internal classes ]
internal struct PageInfo // FEATURE : change back to class for count access for query caching
{
public PageInfo(int pagenum, int uniquecount, int duplicatecount)
{
PageNumber = pagenum;
UniqueCount = uniquecount;
}
public int PageNumber;
public int UniqueCount;
}
internal struct KeyInfo
{
public KeyInfo(int recnum)
{
RecordNumber = recnum;
DuplicateBitmapNumber = -1;
}
public KeyInfo(int recnum, int bitmaprec)
{
RecordNumber = recnum;
DuplicateBitmapNumber = bitmaprec;
}
public int RecordNumber;
public int DuplicateBitmapNumber;
}
internal class Page<T>
{
public Page() // kludge so the compiler doesn't complain
{
DiskPageNumber = -1;
RightPageNumber = -1;
tree = new SafeDictionary<T, KeyInfo>(Global.PageItemCount);
isDirty = false;
FirstKey = default(T);
}
public int DiskPageNumber;
public int RightPageNumber;
public T FirstKey;
public bool isDirty;
public SafeDictionary<T, KeyInfo> tree;
public List<int> allocblocks = null; // for string keys in HF key store
}
#endregion
internal class MGIndex<T> where T : IComparable<T>
{
ILog _log = LogManager.GetLogger(typeof(MGIndex<T>));
private SafeSortedList<T, PageInfo> _pageList = new SafeSortedList<T, PageInfo>();
//private SafeDictionary<int, Page<T>> _cache = new SafeDictionary<int, Page<T>>();
private IKV<int, Page<T>> _cache = null;//new SafeSortedList<int, Page<T>>();
private List<int> _pageListDiskPages = new List<int>();
private IndexFile<T> _index;
private bool _AllowDuplicates = true;
private int _LastIndexedRecordNumber = 0;
public MGIndex(string path, string filename, byte keysize, bool allowdups)
{
if (Global.UseLessMemoryStructures)
_cache = new SafeSortedList<int, Page<T>>();
else
_cache = new SafeDictionary<int, Page<T>>();
_AllowDuplicates = allowdups;
if (path.EndsWith(Path.DirectorySeparatorChar.ToString()) == false)
path += Path.DirectorySeparatorChar;
_index = new IndexFile<T>(path + filename, keysize);
// load page list
_index.GetPageList(_pageListDiskPages, _pageList, out _LastIndexedRecordNumber);
if (_pageList.Count() == 0)
{
Page<T> page = new Page<T>();
page.FirstKey = (T)RDBDataType<T>.GetEmpty();
page.DiskPageNumber = _index.GetNewPageNumber();
page.isDirty = true;
_pageList.Add(page.FirstKey, new PageInfo(page.DiskPageNumber, 0, 0));
_cache.Add(page.DiskPageNumber, page);
}
}
public int GetLastIndexedRecordNumber()
{
return _LastIndexedRecordNumber;
}
public MGRB Query(T from, T to, int maxsize)
{
MGRB bits = new MGRB();
T temp = default(T);
if (from.CompareTo(to) > 0) // check values order
{
temp = from;
from = to;
to = temp;
}
// find first page and do > than
bool found = false;
int startpos = FindPageOrLowerPosition(from, ref found);
// find last page and do < than
int endpos = FindPageOrLowerPosition(to, ref found);
bool samepage = startpos == endpos;
// from key page
Page<T> page = LoadPage(_pageList.GetValue(startpos).PageNumber);
T[] keys = page.tree.Keys();
Array.Sort(keys);
// find better start position rather than 0
int pos = Array.BinarySearch<T>(keys, from); // FEATURE : rewrite??
if (pos < 0) pos = ~pos;
for (int i = pos; i < keys.Length; i++)
{
T k = keys[i];
int bn = page.tree[k].DuplicateBitmapNumber;
if (samepage)
{
if (k.CompareTo(from) >= 0 && k.CompareTo(to) <= 0) // if from,to same page
bits = bits.Or(_index.GetDuplicateBitmap(bn));
}
else
{
if (k.CompareTo(from) >= 0)
bits = bits.Or(_index.GetDuplicateBitmap(bn));
}
}
if (!samepage)
{
// to key page
page = LoadPage(_pageList.GetValue(endpos).PageNumber);
keys = page.tree.Keys();
Array.Sort(keys);
// find better end position rather than last key
pos = Array.BinarySearch<T>(keys, to);
if (pos < 0) pos = ~pos;
for (int i = 0; i <= pos; i++)
{
T k = keys[i];
int bn = page.tree[k].DuplicateBitmapNumber;
if (k.CompareTo(to) <= 0)
bits = bits.Or(_index.GetDuplicateBitmap(bn));
}
// do all pages in between
for (int i = startpos + 1; i < endpos; i++)
{
doPageOperation(ref bits, i);
}
}
return bits;
}
public MGRB Query(RDBExpression exp, T from, int maxsize)
{
T key = from;
if (exp == RDBExpression.Equal || exp == RDBExpression.NotEqual)
return doEqualOp(exp, key, maxsize);
// FEATURE : optimize complement search if page count less for the complement pages
if (exp == RDBExpression.Less || exp == RDBExpression.LessEqual)
{
return doLessOp(exp, key);
}
else if (exp == RDBExpression.Greater || exp == RDBExpression.GreaterEqual)
{
return doMoreOp(exp, key);
}
return new MGRB(); // blank results
}
private object _setlock = new object();
public void Set(T key, int val)
{
lock (_setlock)
{
PageInfo pi;
Page<T> page = LoadPage(key, out pi);
KeyInfo ki;
if (page.tree.TryGetValue(key, out ki))
{
// item exists
if (_AllowDuplicates)
{
SaveDuplicate(key, ref ki);
// set current record in the bitmap also
_index.SetBitmapDuplicate(ki.DuplicateBitmapNumber, val);
}
ki.RecordNumber = val;
page.tree[key] = ki; // structs need resetting
}
else
{
// new item
ki = new KeyInfo(val);
if (_AllowDuplicates)
SaveDuplicate(key, ref ki);
pi.UniqueCount++;
page.tree.Add(key, ki);
}
if (page.tree.Count() > Global.PageItemCount)
SplitPage(page);
_LastIndexedRecordNumber = val;
page.isDirty = true;
}
}
public bool Get(T key, out int val)
{
val = -1;
PageInfo pi;
Page<T> page = LoadPage(key, out pi);
KeyInfo ki;
bool ret = page.tree.TryGetValue(key, out ki);
if (ret)
val = ki.RecordNumber;
return ret;
}
public void SaveIndex()
{
//_log.Debug("Total split time (s) = " + _totalsplits);
//_log.Debug("Total pages = " + _pageList.Count);
int[] keys = _cache.Keys();
Array.Sort(keys);
// save index to disk
foreach (var i in keys)
{
var p = _cache.GetValue(i);
if (p.isDirty)
{
_index.SavePage(p);
p.isDirty = false;
}
}
_index.SavePageList(_pageList, _pageListDiskPages);
_index.BitmapFlush();
}
public void Shutdown()
{
SaveIndex();
// save page list
//_index.SavePageList(_pageList, _pageListDiskPages);
// shutdown
_index.Shutdown();
}
public void FreeMemory()
{
_index.FreeMemory();
try
{
List<int> free = new List<int>();
foreach (var k in _cache.Keys())
{
var val = _cache.GetValue(k);
if (val.isDirty == false)
free.Add(k);
}
_log.Info("releasing page count = " + free.Count + " out of " + _cache.Count());
foreach (var i in free)
_cache.Remove(i);
}
catch { }
}
public IEnumerable<int> GetDuplicates(T key)
{
PageInfo pi;
Page<T> page = LoadPage(key, out pi);
KeyInfo ki;
bool ret = page.tree.TryGetValue(key, out ki);
if (ret)
// get duplicates
if (ki.DuplicateBitmapNumber != -1)
return _index.GetDuplicatesRecordNumbers(ki.DuplicateBitmapNumber);
return new List<int>();
}
public void SaveLastRecordNumber(int recnum)
{
_index.SaveLastRecordNumber(recnum);
}
public bool RemoveKey(T key)
{
PageInfo pi;
Page<T> page = LoadPage(key, out pi);
bool b = page.tree.Remove(key);
// TODO : reset the first key for page ??
if (b)
{
pi.UniqueCount--;
// FEATURE : decrease dup count
}
page.isDirty = true;
return b;
}
#region [ P R I V A T E ]
private MGRB doMoreOp(RDBExpression exp, T key)
{
bool found = false;
int pos = FindPageOrLowerPosition(key, ref found);
MGRB result = new MGRB();
if (pos < _pageList.Count())
{
// all the pages after
for (int i = pos + 1; i < _pageList.Count(); i++)
doPageOperation(ref result, i);
}
// key page
Page<T> page = LoadPage(_pageList.GetValue(pos).PageNumber);
T[] keys = page.tree.Keys();
Array.Sort(keys);
// find better start position rather than 0
pos = Array.BinarySearch<T>(keys, key);
if (pos < 0) pos = ~pos;
for (int i = pos; i < keys.Length; i++)
{
T k = keys[i];
int bn = page.tree[k].DuplicateBitmapNumber;
if (k.CompareTo(key) > 0)
result = result.Or(_index.GetDuplicateBitmap(bn));
if (exp == RDBExpression.GreaterEqual && k.CompareTo(key) == 0)
result = result.Or(_index.GetDuplicateBitmap(bn));
}
return result;
}
private MGRB doLessOp(RDBExpression exp, T key)
{
bool found = false;
int pos = FindPageOrLowerPosition(key, ref found);
MGRB result = new MGRB();
if (pos > 0)
{
// all the pages before
for (int i = 0; i < pos - 1; i++)
doPageOperation(ref result, i);
}
// key page
Page<T> page = LoadPage(_pageList.GetValue(pos).PageNumber);
T[] keys = page.tree.Keys();
Array.Sort(keys);
// find better end position rather than last key
pos = Array.BinarySearch<T>(keys, key);
if (pos < 0) pos = ~pos;
for (int i = 0; i < pos; i++)
{
T k = keys[i];
if (k.CompareTo(key) > 0)
break;
int bn = page.tree[k].DuplicateBitmapNumber;
if (k.CompareTo(key) < 0)
result = result.Or(_index.GetDuplicateBitmap(bn));
if (exp == RDBExpression.LessEqual && k.CompareTo(key) == 0)
result = result.Or(_index.GetDuplicateBitmap(bn));
}
return result;
}
private MGRB doEqualOp(RDBExpression exp, T key, int maxsize)
{
PageInfo pi;
Page<T> page = LoadPage(key, out pi);
KeyInfo k;
if (page.tree.TryGetValue(key, out k))
{
int bn = k.DuplicateBitmapNumber;
if (exp == RDBExpression.Equal)
return _index.GetDuplicateBitmap(bn);
else
return _index.GetDuplicateBitmap(bn).Not(maxsize);
}
else
{
if (exp == RDBExpression.NotEqual)
return new MGRB().Not(maxsize);
else
return new MGRB();
}
}
private void doPageOperation(ref MGRB res, int pageidx)
{
Page<T> page = LoadPage(_pageList.GetValue(pageidx).PageNumber);
T[] keys = page.tree.Keys(); // avoid sync issues
foreach (var k in keys)
{
int bn = page.tree[k].DuplicateBitmapNumber;
res = res.Or(_index.GetDuplicateBitmap(bn));
}
}
private double _totalsplits = 0;
private void SplitPage(Page<T> page)
{
// split the page
DateTime dt = FastDateTime.Now;
Page<T> newpage = new Page<T>();
newpage.DiskPageNumber = _index.GetNewPageNumber();
newpage.RightPageNumber = page.RightPageNumber;
newpage.isDirty = true;
page.RightPageNumber = newpage.DiskPageNumber;
_pageList.Remove(page.FirstKey);
// get and sort keys
T[] keys = page.tree.Keys();
Array.Sort<T>(keys);
// copy data to new
for (int i = keys.Length / 2; i < keys.Length; i++)
{
newpage.tree.Add(keys[i], page.tree[keys[i]]);
// remove from old page
page.tree.Remove(keys[i]);
}
// set the first key
newpage.FirstKey = keys[keys.Length / 2]; // new key
// remove keys from page list
_pageList.Remove(newpage.FirstKey);
page.FirstKey = keys[0]; // new key
// re add to page list
_pageList.Add(page.FirstKey, new PageInfo(page.DiskPageNumber, page.tree.Count(), 0));
_pageList.Add(newpage.FirstKey, new PageInfo(newpage.DiskPageNumber, newpage.tree.Count(), 0));
_cache.Add(newpage.DiskPageNumber, newpage);
_totalsplits += FastDateTime.Now.Subtract(dt).TotalSeconds;
}
private Page<T> LoadPage(T key, out PageInfo pageinfo)
{
int pagenum = -1;
// find page in list of pages
bool found = false;
int pos = 0;
if (key != null)
pos = FindPageOrLowerPosition(key, ref found);
pageinfo = _pageList.GetValue(pos);
pagenum = pageinfo.PageNumber;
Page<T> page;
if (_cache.TryGetValue(pagenum, out page) == false)
{
//load page from disk
page = _index.LoadPageFromPageNumber(pagenum);
_cache.Add(pagenum, page);
}
return page;
}
private Page<T> LoadPage(int pagenum)
{
Page<T> page;
if (_cache.TryGetValue(pagenum, out page) == false)
{
//load page from disk
page = _index.LoadPageFromPageNumber(pagenum);
_cache.Add(pagenum, page);
}
return page;
}
private void SaveDuplicate(T key, ref KeyInfo ki)
{
if (ki.DuplicateBitmapNumber == -1)
ki.DuplicateBitmapNumber = _index.GetBitmapDuplaicateFreeRecordNumber();
_index.SetBitmapDuplicate(ki.DuplicateBitmapNumber, ki.RecordNumber);
}
private int FindPageOrLowerPosition(T key, ref bool found)
{
if (_pageList.Count() == 0)
return 0;
// binary search
int lastlower = 0;
int first = 0;
int last = _pageList.Count() - 1;
int mid = 0;
while (first <= last)
{
mid = (first + last) >> 1;
T k = _pageList.GetKey(mid);
int compare = k.CompareTo(key);
if (compare < 0)
{
lastlower = mid;
first = mid + 1;
}
if (compare == 0)
{
found = true;
return mid;
}
if (compare > 0)
{
last = mid - 1;
}
}
return lastlower;
}
#endregion
internal object[] GetKeys()
{
List<object> keys = new List<object>();
for (int i = 0; i < _pageList.Count(); i++)
{
Page<T> page = LoadPage(_pageList.GetValue(i).PageNumber);
foreach (var k in page.tree.Keys())
keys.Add(k);
}
return keys.ToArray();
}
internal int Count()
{
int count = 0;
for (int i = 0; i < _pageList.Count(); i++)
{
Page<T> page = LoadPage(_pageList.GetValue(i).PageNumber);
//foreach (var k in page.tree.Keys())
// count++;
count += page.tree.Count();
}
return count;
}
}
}
================================================
FILE: RaptorDB/Indexes/tokenizer.cs
================================================
using System.Collections.Generic;
namespace RaptorDB
{
class tokenizer : ITokenizer
{
public Dictionary<string, int> GenerateWordFreq(string text)
{
Dictionary<string, int> dic = new Dictionary<string, int>(500);
char[] chars = text.ToCharArray();
int index = 0;
int look = 0;
int count = chars.Length;
int lastlang = langtype(chars[0]);
while (index < count)
{
int lang = -1;
while (look < count)
{
char c = chars[look];
lang = langtype(c);
if (lang == lastlang)
look++;
else
break;
}
if (lastlang > -1)
ParseString(dic, chars, look, index);
index = look;
lastlang = lang;
}
return dic;
}
private static int langtype(char c)
{
if (char.IsDigit(c))
return 0;
else if (char.IsWhiteSpace(c))
return -1;
else if (char.IsPunctuation(c))
return -1;
else if (char.IsLetter(c)) // FEATURE : language checking here
return 1;
else
return -1;
}
private static void ParseString(Dictionary<string, int> dic, char[] chars, int end, int start)
{
// check if upper lower case mix -> extract words
int uppers = 0;
bool found = false;
for (int i = start; i < end; i++)
{
if (char.IsUpper(chars[i]))
uppers++;
}
// not all uppercase
if (uppers != end - start - 1)
{
int lastUpper = start;
string word = "";
for (int i = start + 1; i < end; i++)
{
char c = chars[i];
if (char.IsUpper(c))
{
found = true;
word = new string(chars, lastUpper, i - lastUpper).ToLowerInvariant().Trim();
AddDictionary(dic, word);
lastUpper = i;
}
}
if (lastUpper > start)
{
string last = new string(chars, lastUpper, end - lastUpper).ToLowerInvariant().Trim();
if (word != last)
AddDictionary(dic, last);
}
}
if (found == false)
{
string s = new string(chars, start, end - start).ToLowerInvariant().Trim();
AddDictionary(dic, s);
}
}
private static void AddDictionary(Dictionary<string, int> dic, string word)
{
if (word == null)
return;
int l = word.Length;
// too long
if (l > Global.DefaultStringKeySize)
return;
// too short
if (l < 2)
return;
addword(dic, word);
}
private static void addword(Dictionary<string, int> dic, string word)
{
int cc = 0;
if (dic.TryGetValue(word, out cc))
dic[word] = ++cc;
else
dic.Add(word, 1);
}
}
}
================================================
FILE: RaptorDB/Properties/Resources.Designer.cs
================================================
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18213
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RaptorDB.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RaptorDB.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to The following error occurred and the json document is below, you can skip this
///document if you wish by incrementing the %c% file :
///
///%ex%
///------------------------------------------------------------------------------
///The json document is :
///
///%js%
///
///.
/// </summary>
internal static string msg {
get {
return ResourceManager.GetString("msg", resourceCulture);
}
}
}
}
================================================
FILE: RaptorDB/Properties/Resources.resx
================================================
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="msg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\replication\msg.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>
================================================
FILE: RaptorDB/REST/aWebServer.cs
================================================
using System;
using System.Net;
using System.Text;
using System.IO;
using System.Threading.Tasks;
using System.Reflection;
using System.Collections.Generic;
using System.IO.Compression;
namespace RaptorDB
{
public abstract class aWebServer
{
public aWebServer(int HttpPort, bool localonly, AuthenticationSchemes authenticationType, string apiPrefix)
{
_apiPrefix = apiPrefix;
_authenticationType = authenticationType;
_localonly = localonly;
_port = HttpPort;
Console.WriteLine("web port = " + _port);
Task.Factory.StartNew(() => Start(), TaskCreationOptions.LongRunning);
}
public delegate void Handler(HttpListenerContext ctx);
public abstract void InitializeCommandHandler(Dictionary<string, Handler> handler);
#region [ properties ]
private string _S = Path.DirectorySeparatorChar.ToString();
internal ILog _log = LogManager.GetLogger(typeof(aWebServer));
private bool _run = true;
private int _port;
private HttpListener _server;
private bool _localonly = false;
private Dictionary<string, Handler> _handler = new Dictionary<string, Handler>();
internal Dictionary<string, string> _WebCache = new Dictionary<string, string>();
private AuthenticationSchemes _authenticationType = AuthenticationSchemes.None;
private string _apiPrefix = "myapi";
#endregion
#region [ web call back handlers ]
private void ListenerCallback(IAsyncResult ar)
{
var listener = ar.AsyncState as HttpListener;
var ctx = listener.EndGetContext(ar);
_log.Debug("Remote Address = " + ctx.Request.RemoteEndPoint.Address);
try
{
//do some stuff
string path = ctx.Request.Url.GetComponents(UriComponents.Path, UriFormat.Unescaped).ToLower();
if (ctx.User != null)
_log.Debug("user : " + ctx.User.Identity.Name);
else
{
//ctx.Response.Redirect("login");
//return;
}
string webpath = "WEB\\";
webpath = webpath.Replace("\\", "/");
bool handled = false;
if (path.StartsWith(_apiPrefix))
{
string command = path.Replace(_apiPrefix + "/", "");
if (command.Contains("?"))
command = command.Substring(0, command.IndexOf('?') - 1);
if (command.Contains("/"))
command = command.Substring(0, command.IndexOf('/'));
Handler handler = null;
if (_handler.TryGetValue(command, out handler))
{
handled = true;
handler(ctx);
}
}
if (!handled)
{
if (path == "")
{
ctx.Response.ContentType = "text/html";
WriteResponse(ctx, 200, ReadFromStream(_WebCache[(webpath + "index.html").ToLower()]), false);
}
else
{
if (path.EndsWith(_apiPrefix + ".png") && File.Exists("logo.png"))
{
OutPutContentType(ctx, path);
WriteResponse(ctx, 200, File.ReadAllBytes("logo.png"), false);
}
else if (_WebCache.ContainsKey((webpath + path).ToLower()))
{
bool compress = OutPutContentType(ctx, path);
var o = _WebCache[(webpath + path).ToLower()];
WriteResponse(ctx, 200, ReadFromStream(o), compress);
}
else
WriteResponse(ctx, 404, "route path not found : " + ctx.Request.Url.GetComponents(UriComponents.Path, UriFormat.Unescaped));
}
}
ctx.Response.OutputStream.Close();
}
catch (Exception ex)
{
_log.Error(ex);
}
}
#endregion
#region [ internal ]
internal void Stop()
{
_run = false;
}
internal static bool OutPutContentType(HttpListenerContext ctx, string path)
{
bool compress = false;
switch (Path.GetExtension(path).ToLower())
{
case ".jpg":
case ".jpeg":
ctx.Response.ContentType = "image/jpeg"; break;
case ".gif":
ctx.Response.ContentType = "image/gif"; break;
case ".mht":
compress = true;
ctx.Response.ContentType = "multipart/related"; break;
case ".eml":
compress = true;
ctx.Response.ContentType = "message/rfc822"; break;//"application/x-mimearchive"; break;
case ".json":
ctx.Response.ContentEncoding = UTF8Encoding.UTF8;
ctx.Response.ContentType = "application/json"; break;
case ".js":
ctx.Response.ContentEncoding = UTF8Encoding.UTF8;
ctx.Response.ContentType = "application/javascript"; break;
case ".css":
ctx.Response.ContentType = "text/css"; break;
case ".html":
case ".htm":
compress = true;
ctx.Response.ContentEncoding = UTF8Encoding.UTF8;
ctx.Response.ContentType = "text/html"; break;
case ".pdf":
ctx.Response.ContentType = "application/pdf"; break;
case ".doc":
case ".docx":
ctx.Response.ContentType = "application/msword"; break;
case ".xls":
case ".xlsx":
ctx.Response.ContentType = "application/vnd.ms-excel"; break;
default:
ctx.Response.ContentType = "application/octet-stream"; break;
}
return compress;
}
internal void WriteResponse(HttpListenerContext ctx, int code, string msg)
{
WriteResponse(ctx, code, Encoding.UTF8.GetBytes(msg), false);
}
internal void WriteResponse(HttpListenerContext ctx, int code, string msg, bool compress)
{
WriteResponse(ctx, code, Encoding.UTF8.GetBytes(msg), compress);
}
internal void WriteResponse(HttpListenerContext ctx, int code, byte[] data, bool compress)
{
ctx.Response.StatusCode = code;
ctx.Response.AppendHeader("Access-Control-Allow-Origin", "*");
byte[] b = data;
if (compress == true && b.Length > 100 * 1024)
{
_log.Debug("original data size : " + b.Length.ToString("#,0"));
using (var ms = new MemoryStream())
{
using (var zip = new GZipStream(ms, CompressionMode.Compress, true))
zip.Write(b, 0, b.Length);
b = ms.ToArray();
}
_log.Debug("compressed size : " + b.Length.ToString("#,0"));
ctx.Response.AppendHeader("Content-Encoding", "gzip");
}
ctx.Response.ContentLength64 = b.LongLength;
ctx.Response.OutputStream.Write(b, 0, b.Length);
}
#endregion
#region [ private ]
private void Start()
{
try
{
InitializeCommandHandler(_handler);
ReadResources();
_server = new HttpListener();
if (_authenticationType != AuthenticationSchemes.None)
_server.AuthenticationSchemes = _authenticationType;
if (_localonly)
{
_server.Prefixes.Add("http://localhost:" + _port + "/");
_server.Prefixes.Add("http://127.0.0.1:" + _port + "/");
_server.Prefixes.Add("http://" + Environment.MachineName + ":" + _port + "/");
}
else
_server.Prefixes.Add("http://*:" + _port + "/");
_server.Start();
while (_run)
{
var context = _server.BeginGetContext(new AsyncCallback(ListenerCallback), _server);
context.AsyncWaitHandle.WaitOne();
}
}
catch (Exception ex)
{
_log.Error(ex);
}
}
private byte[] ReadFromStream(string name)
{
using (MemoryStream ms = new MemoryStream())
{
Assembly.GetExecutingAssembly().GetManifestResourceStream(name).CopyTo(ms);
return ms.ToArray();
}
}
private void ReadResources()
{
string name = Assembly.GetExecutingAssembly().GetName().Name + ".";
foreach (var r in Assembly.GetExecutingAssembly().GetManifestResourceNames())
{
string s = r.Replace(name, "");
if (s.StartsWith("WEB"))
{
var ext = Path.GetExtension(s);
s = s.Replace(ext, "").Replace(".", "/");
var p = s + ext;
_WebCache.Add(p.ToLower(), r);
}
}
}
#endregion
}
}
================================================
FILE: RaptorDB/REST/rdbRest.cs
================================================
using RaptorDB.Common;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
namespace RaptorDB
{
#region [ rdb rest helper classes ]
public class RDBRoute
{
public string URL;
public Type EntityType;
public string Viewname;
public ServerSideFunc function;
public override string ToString()
{
if (EntityType != null)
return "POST-able type : " + EntityType.Name;
else if (function != null)
return "Server side function";
else if (Viewname != "")
return "View name : " + Viewname;
return "Undefined";
}
}
public interface IRouteAPI
{
void AddRoute(RDBRoute route);
void RegisterView<T>(View<T> view);
}
public interface IRDBRouting
{
void Initialize(IRouteAPI api);
}
public class RDBJsonContainer
{
public string URL;
public DateTime date;
public string json;
public string useragent;
public Guid docid;
}
#endregion
class rdbRest : aWebServer, IRouteAPI
{
public rdbRest(int HttpPort, RaptorDB rdb, string routingpath, bool localonly) : base(HttpPort, localonly, System.Net.AuthenticationSchemes.None, "raptordb")
{
_rdb = rdb;
//save = _rdb.GetType().GetMethod("Save", BindingFlags.Instance | BindingFlags.Public);
//register = _rdb.GetType().GetMethod("RegisterView", BindingFlags.Instance | BindingFlags.Public);
if (_S == "/")
_path = routingpath.Replace("\\", "/");
else
_path = routingpath;
}
private string _S = Path.DirectorySeparatorChar.ToString();
private RaptorDB _rdb;
private string _path;
private SafeDictionary<string, RDBRoute> _routing = new SafeDictionary<string, RDBRoute>();
//private KeyStore<Guid> _jsonstore;
public new void Stop()
{
base.Stop();
//_jsonstore.Shutdown();
//_rdb.Shutdown();
}
public void AddRoute(RDBRoute route)
{
_log.Debug("adding route : " + route.URL);
_routing.Add(route.URL.ToLower(), route);
}
public void RegisterView<T>(View<T> view)
{
_log.Debug("registering view : " + view.Name);
AddRoute(new RDBRoute { URL = "RaptorDB/Views/" + view.Name, Viewname = view.Name });
_rdb.RegisterView(view);
}
public override void InitializeCommandHandler(Dictionary<string, Handler> _handler)
{
_handler.Add("getroutes",
(ctx) =>
{
List<object> o = new List<object>();
foreach (var rr in _routing)
o.Add(new { URL = rr.Value.URL, Description = rr.Value.ToString() });
OutputJsonData(ctx, o);
});
_handler.Add("getviews",
(ctx) =>
{
List<object> o = new List<object>();
foreach (var v in _rdb.GetViews())
o.Add(new { Name = v.Name, Description = v.Description, BackgroundIndexing = v.BackgroundIndexing, Version = v.Version, isPrimaryList = v.isPrimaryList });
OutputJsonData(ctx, o);
});
_handler.Add("getschema",
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
if (qry == "")
{
WriteResponse(ctx, 404, "GetSchema requires a viewname to be defined e.g. ?view=customerview");
}
else
{
List<object> o = new List<object>();
string view = qry.Split('=')[1];
var sc = _rdb.GetSchema(view);
foreach (var i in sc.Columns)
o.Add(new { ColumnName = i.Key, Type = i.Value.Name });
OutputJsonData(ctx, o);
}
});
_handler.Add("systeminfo",
(ctx) =>
{
var oo = GetInfo();
var s = fastJSON.JSON.ToJSON(oo, new fastJSON.JSONParameters { UseExtensions = false, UseFastGuid = false, EnableAnonymousTypes = true });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
_handler.Add("action",
(ctx) =>
{
string action = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
switch (action)
{
case "backup":
_rdb.Backup();
WriteResponse(ctx, 200, "\"Done\"");
break;
case "compact":
_rdb.GetKVHF().CompactStorageHF();
WriteResponse(ctx, 200, "\"Done\"");
break;
case "getconfigs":
WriteResponse(ctx, 200, File.ReadAllText(_path + "raptordb.config"));
break;
}
});
_handler.Add("docget", // takes : guid
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
var g = Guid.Parse(qry);
_log.Debug("docid = " + qry);
var s = fastJSON.JSON.ToNiceJSON(_rdb.Fetch(g), new fastJSON.JSONParameters { UseExtensions = true, UseFastGuid = false, UseEscapedUnicode = false });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
_handler.Add("dochistory", // takes : guid
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
var g = Guid.Parse(qry);
var h = _rdb.FetchHistoryInfo(g);
_log.Debug("docid = " + qry);
var s = fastJSON.JSON.ToJSON(h, new fastJSON.JSONParameters { UseExtensions = false, UseFastGuid = false, UseEscapedUnicode = false });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
_handler.Add("docversion", // takes : version
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
var v = int.Parse(qry);
var oo = _rdb.FetchVersion(v);
var s = fastJSON.JSON.ToNiceJSON(oo, new fastJSON.JSONParameters { UseExtensions = true, UseFastGuid = false, UseEscapedUnicode = false });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
_handler.Add("fileget", // takes : guid
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
var g = Guid.Parse(qry);
_log.Debug("fileid = " + qry);
var s = fastJSON.JSON.ToNiceJSON(_rdb.FetchBytes(g), new fastJSON.JSONParameters { UseExtensions = true, UseFastGuid = false, UseEscapedUnicode = false });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
_handler.Add("filehistory", // takes : guid
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
var g = Guid.Parse(qry);
var h = _rdb.FetchBytesHistoryInfo(g);
_log.Debug("fileid = " + qry);
var s = fastJSON.JSON.ToJSON(h, new fastJSON.JSONParameters { UseExtensions = false, UseFastGuid = false, UseEscapedUnicode = false });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
_handler.Add("fileversion", // takes : version
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
var v = int.Parse(qry);
var oo = _rdb.FetchBytesVersion(v);
var s = fastJSON.JSON.ToNiceJSON(oo, new fastJSON.JSONParameters { UseExtensions = true, UseFastGuid = false, UseEscapedUnicode = false });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
_handler.Add("docsearch", // takes : string & count =x &start=y
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
int start = 0;
int count = -1;
var m = _start_regex.Match(qry);
if (m.Success)
{
start = int.Parse(m.Groups["start"].Value);
qry = qry.Replace(m.Value, "");
}
m = _count_regex.Match(qry);
if (m.Success)
{
count = int.Parse(m.Groups["count"].Value);
qry = qry.Replace(m.Value, "");
}
var h = _rdb.FullTextSearch(qry);
List<int> list = new List<int>();
_log.Debug("search = " + qry);
if (count > -1 && h.Length > 0)
{
int c = h.Length;
for (int i = start; i < start + count && i < c; i++)
list.Add(h[i]);
}
var obj = new
{
Items = list,
Count = count,
TotalCount = h.Length
};
var s = fastJSON.JSON.ToJSON(obj, new fastJSON.JSONParameters { UseExtensions = false, UseFastGuid = false, UseEscapedUnicode = false, EnableAnonymousTypes = true });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
_handler.Add("hfkeys", // takes : count =x &start=y
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
int start = 0;
int count = -1;
var m = _start_regex.Match(qry);
if (m.Success)
{
start = int.Parse(m.Groups["start"].Value);
qry = qry.Replace(m.Value, "");
}
m = _count_regex.Match(qry);
if (m.Success)
{
count = int.Parse(m.Groups["count"].Value);
qry = qry.Replace(m.Value, "");
}
var h = _rdb.GetKVHF().GetKeysHF();
List<string> list = new List<string>();
if (count > -1 && h.Length > 0)
{
int c = h.Length;
for (int i = start; i < start + count && i < c; i++)
list.Add(h[i]);
}
var obj = new
{
Items = list,
Count = count,
TotalCount = h.Length
};
var s = fastJSON.JSON.ToJSON(obj, new fastJSON.JSONParameters { UseExtensions = false, UseFastGuid = false, UseEscapedUnicode = false, EnableAnonymousTypes = true });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
_handler.Add("hfget", // takes : string
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
var h = _rdb.GetKVHF().GetObjectHF(qry);
var s = fastJSON.JSON.ToNiceJSON(h, new fastJSON.JSONParameters { UseExtensions = false, UseFastGuid = false, UseEscapedUnicode = false, EnableAnonymousTypes = true });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
});
_handler.Add("viewinfo", // takes : viewname
(ctx) =>
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
if (qry == "")
{
WriteResponse(ctx, 404, "ViewInfo requires a viewname to be defined e.g. ?customerview");
}
else
{
var vi = GetViewInfo(qry);
if (vi == "")
WriteResponse(ctx, 500, "View not found.");
else
{
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, vi);
}
}
});
_handler.Add("excelexport",
(ctx) =>
{
string path = ctx.Request.Url.GetComponents(UriComponents.Path, UriFormat.Unescaped).ToLower();
var data = DoQuery(_rdb, ctx, path.Replace("raptordb/excelexport/", ""), null);
ctx.Response.AddHeader("content-disposition", "attachment;filename=" + data.Title + ".csv");
ctx.Response.AddHeader("Content-Type", "application/vnd.ms-excel");
_log.Debug("exporting to excel rows : " + data.Rows.Count);
WriteResponse(ctx, 200, WriteCsv(data.Rows), true);
});
_handler.Add("views",
(ctx) =>
{
string path = ctx.Request.Url.GetComponents(UriComponents.Path, UriFormat.Unescaped).ToLower();
ProcessGET(_rdb, ctx, path.Replace("raptordb/views/", ""), null);
});
}
#region [ private ]
private string GetViewInfo(string name)
{
var v = _rdb.GetViews().Find(x => x.Name.ToLower() == name.ToLower());
if (v == null)
return "";
var p = new Dictionary<string, string>();
foreach (var pr in v.Schema.GetProperties())
p.Add(pr.Name, pr.PropertyType.ToString());
foreach (var pr in v.Schema.GetFields())
p.Add(pr.Name, pr.FieldType.ToString());
var obj = new
{
View = v,
Schema = p
};
var s = fastJSON.JSON.ToJSON(obj, new fastJSON.JSONParameters { UseFastGuid = false, UseEscapedUnicode = false, EnableAnonymousTypes = true });
return s;
}
private object GetInfo()
{
var ts = _rdb.Uptime();
var s = "" + ts.Days + " days, " + ts.Hours + " hours, " + ts.Minutes + " mins, " + ts.Seconds + " secs";
// get info here
return new
{
DocumentCount = _rdb.DocumentCount(),
FileCount = _rdb.FileCount(),
OSVersion = Environment.OSVersion.ToString(),
NumberOfViews = _rdb.GetViews().Count,
HighFrequncyItems = _rdb.GetKVHF().CountHF(),
RaptorDBVersion = FileVersionInfo.GetVersionInfo(this.GetType().Assembly.Location).ProductVersion.ToString(),
DataFolderSize = _rdb.GetDataFolderSize(),
Uptime = s,
MemoryUsage = GetMemoryUsage(),
LogItems = LogManager.GetLastLogs()
};
}
private string GetMemoryUsage() // KLUDGE but works
{
try
{
string fname = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location);
ProcessStartInfo ps = new ProcessStartInfo("tasklist");
ps.Arguments = "/fi \"IMAGENAME eq " + fname + ".*\" /FO CSV /NH";
ps.RedirectStandardOutput = true;
ps.CreateNoWindow = true;
ps.UseShellExecute = false;
var p = Process.Start(ps);
if (p.WaitForExit(1000))
{
var s = p.StandardOutput.ReadToEnd().Split('\"');
return s[9].Replace("\"", "");
}
}
catch { }
return "Unable to get memory usage";
}
private string WriteCsv(List<object> data)//, Stream stream)
{
StringBuilder output = new StringBuilder();
var o = data[0];
foreach (var prop in o.GetType().GetProperties())
{
output.Append(prop.Name); // header
output.Append(",");
}
foreach (var prop in o.GetType().GetFields())
{
output.Append(prop.Name); // header
output.Append(",");
}
output.AppendLine();
foreach (var item in data)
{
foreach (var prop in o.GetType().GetProperties())
{
output.Append("\"" + prop.GetValue(item, null));
output.Append("\",");
}
foreach (var prop in o.GetType().GetFields())
{
output.Append("\"" + prop.GetValue(item));
output.Append("\",");
}
output.AppendLine();
}
return output.ToString();
}
//private MethodInfo register = null;
//private void CompileAndRegisterScriptRoutes(string routefolder)
//{
// // compile & register views
// string[] files = Directory.GetFiles(routefolder, "*.route");
// foreach (var fn in files)
// {
// Assembly a = CompileScript(fn);
// if (a != null)
// {
// foreach (var t in a.GetTypes())
// {
// if (typeof(IRDBRouting).IsAssignableFrom(t))
// {
// IRDBRouting r = (IRDBRouting)Activator.CreateInstance(t);
// r.Initialize(this);
// }
// // load views if exists
// foreach (var att in t.GetCustomAttributes(typeof(RegisterViewAttribute), false))
// {
// try
// {
// object o = Activator.CreateInstance(t);
// // handle types when view<T> also
// Type[] args = t.GetGenericArguments();
// if (args.Length == 0)
// args = t.BaseType.GetGenericArguments();
// Type tt = args[0];
// var m = register.MakeGenericMethod(new Type[] { tt });
// m.Invoke(_rdb, new object[] { o });
// }
// catch (Exception ex)
// {
// _log.Error(ex);
// }
// }
// }
// }
// }
//}
//private Assembly CompileScript(string file)
//{
// try
// {
// _log.Debug("Compiling route script : " + file);
// CodeDomProvider compiler = CodeDomProvider.CreateProvider("CSharp");
// CompilerParameters compilerparams = new CompilerParameters();
// compilerparams.GenerateInMemory = false;
// compilerparams.GenerateExecutable = false;
// compilerparams.OutputAssembly = file.Replace(".route", ".dll");
// compilerparams.CompilerOptions = "/optimize";
// Regex regex = new Regex(
// @"\/\/\s*ref\s*\:\s*(?<refs>.*)",
// System.Text.RegularExpressions.RegexOptions.IgnoreCase);
// compilerparams.ReferencedAssemblies.Add(typeof(View<>).Assembly.Location); //raprotdb.common.dll
// compilerparams.ReferencedAssemblies.Add(typeof(object).Assembly.Location); //mscorlib.dll
// compilerparams.ReferencedAssemblies.Add(typeof(System.Uri).Assembly.Location); //system.dll
// compilerparams.ReferencedAssemblies.Add(typeof(System.Linq.Enumerable).Assembly.Location);//system.core.dll
// compilerparams.ReferencedAssemblies.Add(typeof(IRDBRouting).Assembly.Location); //raptordb.rest.dll
// foreach (Match m in regex.Matches(File.ReadAllText(file)))
// {
// string str = m.Groups["refs"].Value.Trim();
// Assembly a = Assembly.LoadWithPartialName(Path.GetFileNameWithoutExtension(str));//load from GAC if possible
// if (a != null)
// compilerparams.ReferencedAssemblies.Add(a.Location);
// else
// {
// string assm = Path.GetDirectoryName(this.GetType().Assembly.Location) + _S + str;
// a = Assembly.LoadFrom(assm);
// if (a != null)
// compilerparams.ReferencedAssemblies.Add(a.Location);
// else
// _log.Error("unable to find referenced file for view compiling : " + str);
// }
// }
// CompilerResults results = compiler.CompileAssemblyFromFile(compilerparams, file);
// if (results.Errors.HasErrors == true)
// {
// _log.Error("Error compiling route definition : " + file);
// foreach (var e in results.Errors)
// _log.Error(e.ToString());
// return null;
// }
// return results.CompiledAssembly;
// }
// catch (Exception ex)
// {
// _log.Error("Error compiling route definition : " + file);
// _log.Error(ex);
// return null;
// }
//}
private void OutputJsonData(HttpListenerContext ctx, List<object> o)
{
Result<object> resf = new Result<object>(true);
resf.Rows = o;
resf.TotalCount = o.Count;
resf.Count = o.Count;
var s = fastJSON.JSON.ToJSON(resf, new fastJSON.JSONParameters { UseExtensions = false, UseFastGuid = false, EnableAnonymousTypes = true });
ctx.Response.ContentType = "application/json";
WriteResponse(ctx, 200, s);
}
private Regex _start_regex = new Regex(@"[\?\&]?\s*start\s*\=\s*[-+]?(?<start>\d*)", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
private Regex _count_regex = new Regex(@"[\?\&]?\s*count\s*\=\s*[-+]?(?<count>\d*)", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
private Regex _order_regex = new Regex(@"[\?\&]?\s*orderby\s*\=\s*[-+]?(?<orderby>.*)", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
private Result<object> DoQuery(IRaptorDB rdb, HttpListenerContext ctx, string path, RDBRoute route)
{
string qry = ctx.Request.Url.GetComponents(UriComponents.Query, UriFormat.Unescaped);
string viewname = path;
if (route != null)
{
//if (route.EntityType != null)
//{
// if (qry != "")
// {
// // fetch the json document
// string[] s = qry.Split('=');
// object obj = null;
// if (_jsonstore.GetObject(Guid.Parse(s[1].Replace("\"", "")), out obj)
gitextract_wcou_a2z/
├── BuildVersion.cs
├── LICENSE
├── README.md
├── RaptorDB/
│ ├── AssemblyInfo.cs
│ ├── DataTypes/
│ │ └── DataTypes.cs
│ ├── Global.cs
│ ├── Helper/
│ │ ├── Container.cs
│ │ ├── MGRB.cs
│ │ └── WAHBitarray2.cs
│ ├── Indexes/
│ │ ├── BitmapIndex.cs
│ │ ├── Cache.cs
│ │ ├── Hoot.cs
│ │ ├── IIndex.cs
│ │ ├── ITokenizer.cs
│ │ ├── IndexFile.cs
│ │ ├── Indexes.cs
│ │ ├── MGIndex.cs
│ │ └── tokenizer.cs
│ ├── Properties/
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── REST/
│ │ ├── aWebServer.cs
│ │ └── rdbRest.cs
│ ├── RaptorDB.cs
│ ├── RaptorDB.csproj
│ ├── RaptorDBServer.cs
│ ├── Replication/
│ │ ├── Configuration.cs
│ │ ├── Packets.cs
│ │ ├── Readme.txt
│ │ ├── ReplicationClient.cs
│ │ ├── ReplicationServer.cs
│ │ └── msg.txt
│ ├── Storage/
│ │ ├── KeyStore.cs
│ │ ├── KeyStoreHF.cs
│ │ ├── StorageFile.cs
│ │ ├── StorageFileHF.cs
│ │ └── StringHF.cs
│ ├── Views/
│ │ ├── Dynamic.cs
│ │ ├── LINQQuery.cs
│ │ ├── TaskQueue.cs
│ │ ├── ViewHandler.cs
│ │ ├── ViewManager.cs
│ │ └── apimapper.cs
│ ├── WEB/
│ │ ├── bundle.css
│ │ ├── bundle.js
│ │ ├── global.css
│ │ └── index.html
│ └── cron/
│ ├── CronDaemon.cs
│ ├── CronJob.cs
│ └── CronSchedule.cs
├── RaptorDB.Common/
│ ├── DataTypes.cs
│ ├── FieldDescriptor.cs
│ ├── IRaptorDB.cs
│ ├── Interfaces.cs
│ ├── LINQString.cs
│ ├── Logger.cs
│ ├── MiniLZO.cs
│ ├── MurMurHash2.cs
│ ├── NetworkClient.cs
│ ├── Packets.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── RaptorDB.Common.csproj
│ ├── RaptorDBClient.cs
│ ├── SafeDictionary.cs
│ ├── View.cs
│ ├── ZipStorer.cs
│ ├── fastBinaryJSON/
│ │ ├── BJSON.cs
│ │ ├── BJsonParser.cs
│ │ ├── BJsonSerializer.cs
│ │ ├── Helper.cs
│ │ └── dynamic.cs
│ └── fastJSON/
│ ├── Formatter.cs
│ ├── Getters.cs
│ ├── Helper.cs
│ ├── JSON.cs
│ ├── JsonParser.cs
│ ├── JsonSerializer.cs
│ ├── Reflection.cs
│ └── dynamic.cs
├── RaptorDBCore/
│ ├── RaptorDB/
│ │ └── RaptorDB.csproj
│ ├── RaptorDb.Common/
│ │ └── RaptorDb.Common.csproj
│ └── test/
│ ├── sample.cs
│ └── test.csproj
├── RaptorDBServer/
│ ├── Installer.cs
│ ├── Program.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── RaptorDBServer.csproj
│ ├── Service1.Designer.cs
│ ├── Service1.cs
│ └── Service1.resx
├── RaptorDBTest.sln
├── RaptorDB_Doc.nuspec
├── RaptorDbCore.sln
├── Tools/
│ └── buildversion.ncs
├── Views/
│ ├── Class1.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── ServerSide.cs
│ └── Views.csproj
├── WebStudio/
│ ├── README.md
│ ├── build.cmd
│ ├── deploy.cmd
│ ├── package.json
│ ├── rollup.config.js
│ └── src/
│ ├── App.svelte
│ ├── UI/
│ │ ├── Button.svelte
│ │ ├── Modal.svelte
│ │ ├── datatable.svelte
│ │ └── nav.svelte
│ ├── debug.js
│ ├── global.css
│ ├── index.html
│ ├── main.js
│ └── pages/
│ ├── dochistory.svelte
│ ├── docsearch.svelte
│ ├── docview.svelte
│ ├── help.svelte
│ ├── hfbrowser.svelte
│ ├── query.svelte
│ ├── schema.svelte
│ ├── sysconfig.svelte
│ └── sysinfo.svelte
├── build.cmd
├── datagridbinding/
│ ├── Form1.resources
│ ├── Program.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── datagridbinding.csproj
│ ├── frmMain.Designer.cs
│ ├── frmMain.cs
│ ├── frmMain.resx
│ ├── frmStartup.Designer.cs
│ ├── frmStartup.cs
│ └── frmStartup.resx
├── history.txt
├── raptordb.snk
├── test script/
│ ├── run.cmd
│ └── sample.cs
├── testing/
│ ├── AssemblyInfo.cs
│ ├── Class1.cs
│ ├── program.cs
│ └── tests.csproj
├── testing.view
└── vbTestConsole/
├── App.config
├── Module1.vb
├── My Project/
│ ├── Application.Designer.vb
│ ├── Application.myapp
│ ├── AssemblyInfo.vb
│ ├── Resources.Designer.vb
│ ├── Resources.resx
│ ├── Settings.Designer.vb
│ └── Settings.settings
└── vbtestconsole.vbproj
SYMBOL INDEX (1888 symbols across 79 files)
FILE: RaptorDB.Common/DataTypes.cs
class Result (line 11) | public class Result<T>
method Result (line 13) | public Result()
method Result (line 17) | public Result(bool ok)
method Result (line 21) | public Result(bool ok, Exception ex)
class RDBSchema (line 52) | public abstract class RDBSchema : BindableFields
class RDBExtension (line 59) | public static class RDBExtension
method Between (line 68) | public static bool Between(this DateTime value, string fromdate, strin...
method Between (line 73) | public static bool Between<T>(this T value, T from, T to)
method In (line 78) | public static bool In(this byte value, params byte[] values)
method In (line 83) | public static bool In<T>(this T value, params T[] values)
FILE: RaptorDB.Common/FieldDescriptor.cs
class FieldPropertyDescriptor (line 7) | internal class FieldPropertyDescriptor : PropertyDescriptor
method FieldPropertyDescriptor (line 11) | public FieldPropertyDescriptor(FieldInfo field) :
method Equals (line 19) | public override bool Equals(object obj)
method GetHashCode (line 25) | public override int GetHashCode() { return _field.GetHashCode(); }
method ResetValue (line 28) | public override void ResetValue(object component) { }
method CanResetValue (line 29) | public override bool CanResetValue(object component) { return false; }
method ShouldSerializeValue (line 30) | public override bool ShouldSerializeValue(object component) { return t...
method GetValue (line 35) | public override object GetValue(object component) { return _field.GetV...
method SetValue (line 37) | public override void SetValue(object component, object value)
class BindableFields (line 44) | public abstract class BindableFields : ICustomTypeDescriptor
method GetPropertyOwner (line 46) | object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd)
method GetAttributes (line 51) | AttributeCollection ICustomTypeDescriptor.GetAttributes()
method GetClassName (line 56) | string ICustomTypeDescriptor.GetClassName()
method GetComponentName (line 61) | string ICustomTypeDescriptor.GetComponentName()
method GetConverter (line 66) | TypeConverter ICustomTypeDescriptor.GetConverter()
method GetDefaultEvent (line 71) | EventDescriptor ICustomTypeDescriptor.GetDefaultEvent()
method GetDefaultProperty (line 76) | PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty()
method GetEditor (line 81) | object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
method GetEvents (line 86) | EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] ...
method GetEvents (line 91) | EventDescriptorCollection ICustomTypeDescriptor.GetEvents()
method GetProperties (line 99) | PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties()
method GetProperties (line 104) | PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attri...
class FilterCache (line 145) | private class FilterCache
method IsValid (line 149) | public bool IsValid(Attribute[] other)
FILE: RaptorDB.Common/IRaptorDB.cs
class HistoryInfo (line 10) | public class HistoryInfo
type IKeyStoreHF (line 22) | public interface IKeyStoreHF
method GetObjectHF (line 24) | object GetObjectHF(string key);
method SetObjectHF (line 25) | bool SetObjectHF(string key, object obj);
method DeleteKeyHF (line 26) | bool DeleteKeyHF(string key);
method CountHF (line 27) | int CountHF();
method ContainsHF (line 28) | bool ContainsHF(string key);
method GetKeysHF (line 29) | string[] GetKeysHF();
method CompactStorageHF (line 30) | void CompactStorageHF();
method Increment (line 31) | int Increment(string key, int amount);
method Increment (line 32) | decimal Increment(string key, decimal amount);
method Decrement (line 33) | int Decrement(string key, int amount);
method Decrement (line 34) | decimal Decrement(string key, decimal amount);
type IRaptorDB (line 41) | public interface IRaptorDB
method SaveBytes (line 49) | bool SaveBytes(Guid fileID, byte[] bytes);
method Save (line 58) | bool Save<T>(Guid docID, T document);
method Query (line 65) | Result<object> Query(string viewname);
method Query (line 74) | Result<object> Query(string viewname, int start, int count);
method Query (line 82) | Result<object> Query(string viewname, string filter);
method Query (line 92) | Result<object> Query(string viewname, string filter, int start, int co...
method Query (line 102) | Result<object> Query(string viewname, string filter, int start, int co...
method Count (line 109) | int Count(string viewname);
method Count (line 117) | int Count(string viewname, string filter);
method Fetch (line 124) | object Fetch(Guid docID);
method Fetch (line 131) | T Fetch<T>(Guid docID) where T : class;
method FetchBytes (line 138) | byte[] FetchBytes(Guid fileID);
method Backup (line 149) | bool Backup();
method Restore (line 154) | void Restore();
method Delete (line 161) | bool Delete(Guid docid);
method DeleteBytes (line 168) | bool DeleteBytes(Guid fileid);
method AddUser (line 177) | bool AddUser(string username, string oldpassword, string newpassword);
method ServerSide (line 184) | object[] ServerSide(ServerSideFunc func, string filter);
method ServerSide (line 191) | object[] ServerSide<TRowSchema>(ServerSideFunc func, Expression<Predic...
method ServerSide (line 199) | object[] ServerSide(ServerSideFuncWithArgs func, string filter, params...
method ServerSide (line 206) | object[] ServerSide<TRowSchema>(ServerSideFuncWithArgs func, Expressio...
method FullTextSearch (line 213) | int[] FullTextSearch(string filter);
method Query (line 222) | Result<TRowSchema> Query<TRowSchema>(Expression<Predicate<TRowSchema>>...
method Query (line 232) | Result<TRowSchema> Query<TRowSchema>(Expression<Predicate<TRowSchema>>...
method Query (line 243) | Result<TRowSchema> Query<TRowSchema>(Expression<Predicate<TRowSchema>>...
method Query (line 251) | Result<TRowSchema> Query<TRowSchema>(string filter);
method Query (line 261) | Result<TRowSchema> Query<TRowSchema>(string filter, int start, int cou...
method Query (line 272) | Result<TRowSchema> Query<TRowSchema>(string filter, int start, int cou...
method Count (line 280) | int Count<TRowSchema>(Expression<Predicate<TRowSchema>> filter);
method FetchHistory (line 287) | int[] FetchHistory(Guid docid);
method FetchHistoryInfo (line 294) | HistoryInfo[] FetchHistoryInfo(Guid docid);
method FetchBytesHistory (line 301) | int[] FetchBytesHistory(Guid fileid);
method FetchBytesHistoryInfo (line 308) | HistoryInfo[] FetchBytesHistoryInfo(Guid docid);
method FetchVersion (line 315) | object FetchVersion(int versionNumber);
method FetchBytesVersion (line 322) | byte[] FetchBytesVersion(int versionNumber);
method ViewDelete (line 330) | int ViewDelete<TRowSchema>(Expression<Predicate<TRowSchema>> filter);
method ViewDelete (line 338) | int ViewDelete(string viewname, string filter);
method ViewInsert (line 347) | bool ViewInsert<TRowSchema>(Guid id, TRowSchema row);
method ViewInsert (line 356) | bool ViewInsert(string viewname, Guid id, object row);
method DocumentCount (line 362) | long DocumentCount();
method GetKVHF (line 370) | IKeyStoreHF GetKVHF();
method FreeMemory (line 372) | void FreeMemory();
method Shutdown (line 374) | void Shutdown();
method SaveToDocsOnViewInsert (line 376) | void SaveToDocsOnViewInsert(bool yes);
FILE: RaptorDB.Common/Interfaces.cs
class CaseInsensitiveAttribute (line 38) | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
class FullTextAttribute (line 46) | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
class RegisterViewAttribute (line 54) | [AttributeUsage(AttributeTargets.Class)]
class StringIndexLength (line 62) | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
method StringIndexLength (line 65) | public StringIndexLength()
method StringIndexLength (line 69) | public StringIndexLength(byte length)
type IQueryInterface (line 76) | public interface IQueryInterface
method Log (line 82) | void Log(string message);
method Count (line 89) | int Count(string viewname);
method Count (line 97) | int Count(string ViewName, string Filter);
method Fetch (line 104) | object Fetch(Guid guid);
method Fetch (line 111) | T Fetch<T>(Guid guid) where T : class;
method Query (line 114) | Result<T> Query<T>(Expression<Predicate<T>> Filter);
method Query (line 115) | Result<T> Query<T>(Expression<Predicate<T>> Filter, int start, int cou...
method Query (line 116) | Result<T> Query<T>(string Filter);
method Query (line 117) | Result<T> Query<T>(string Filter, int start, int count);
method Count (line 118) | int Count<T>(Expression<Predicate<T>> Filter);
type IMapAPI (line 121) | public interface IMapAPI : IQueryInterface
method Emit (line 128) | void Emit(Guid docid, params object[] data);
method EmitObject (line 136) | void EmitObject<T>(Guid docid, T doc);
method RollBack (line 141) | void RollBack();
method NextRowNumber (line 147) | int NextRowNumber();
method GetKVHF (line 149) | IKeyStoreHF GetKVHF();
type IClientHandler (line 153) | public interface IClientHandler
method GenerateClientData (line 155) | bool GenerateClientData(IQueryInterface api, string username, List<Gui...
type COMMANDS (line 158) | public enum COMMANDS
FILE: RaptorDB.Common/LINQString.cs
class LINQString (line 11) | public class LINQString : ExpressionVisitor
method VisitBinary (line 15) | protected override Expression VisitBinary(BinaryExpression b)
method VisitMethodCall (line 56) | protected override Expression VisitMethodCall(MethodCallExpression m)
method VisitMember (line 69) | protected override Expression VisitMember(MemberExpression m)
method VisitConstant (line 137) | protected override Expression VisitConstant(ConstantExpression c)
method Visit (line 178) | public override Expression Visit(Expression node)
FILE: RaptorDB.Common/Logger.cs
type ILog (line 10) | public interface ILog
method Fatal (line 17) | void Fatal(object msg, params object[] objs);
method Error (line 23) | void Error(object msg, params object[] objs);
method Warn (line 29) | void Warn(object msg, params object[] objs);
method Debug (line 35) | void Debug(object msg, params object[] objs);
method Info (line 41) | void Info(object msg, params object[] objs);
class FileLogger (line 44) | internal class FileLogger
method FileLogger (line 50) | static FileLogger()
method FileLogger (line 53) | private FileLogger()
method Init (line 77) | public void Init(string filename, int sizelimitKB, bool showmethodnames)
method _saveTimer_Elapsed (line 108) | void _saveTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
method ShutDown (line 113) | public void ShutDown()
method WriteData (line 125) | private void WriteData()
method ZipLogs (line 201) | private void ZipLogs(string path, DateTime lastFileDate)
method FormatLog (line 226) | private string FormatLog(string log, string type, string meth, string ...
method Log (line 248) | public void Log(string logtype, string type, string meth, string msg, ...
method GetLastLogs (line 257) | internal List<string> GetLastLogs()
method SetLogLevel (line 269) | public void SetLogLevel(int abovelevel)
class logger (line 275) | internal class logger : ILog
method logger (line 277) | public logger(Type type)
method log (line 284) | private void log(string logtype, string msg, params object[] objs)
method Fatal (line 297) | public void Fatal(object msg, params object[] objs)
method Error (line 302) | public void Error(object msg, params object[] objs)
method Warn (line 308) | public void Warn(object msg, params object[] objs)
method Debug (line 314) | public void Debug(object msg, params object[] objs)
method Info (line 320) | public void Info(object msg, params object[] objs)
class LogManager (line 328) | public static class LogManager
method GetLogger (line 330) | public static ILog GetLogger(Type obj)
method Configure (line 335) | public static void Configure(string filename, int sizelimitKB, bool sh...
method GetLastLogs (line 340) | public static List<string> GetLastLogs()
method Shutdown (line 345) | public static void Shutdown()
method SetLogLevel (line 350) | public static void SetLogLevel(int abovelevel)
FILE: RaptorDB.Common/MiniLZO.cs
method MiniLZO (line 77) | static MiniLZO()
method Compress (line 82) | public static byte[] Compress(byte[] src) { return Compress(src, 0, src....
method Compress (line 83) | public static byte[] Compress(byte[] src, int srcCount) { return Compres...
method Compress (line 84) | public static byte[] Compress(byte[] src, int srcStart, int srcLength)
method Compress (line 103) | public static byte[] Compress(MemoryStream source)
FILE: RaptorDB.Common/MurMurHash2.cs
class MurmurHash2Unsafe (line 96) | public class MurmurHash2Unsafe
method Hash (line 98) | public UInt32 Hash(Byte[] data)
method Hash (line 105) | public unsafe UInt32 Hash(Byte[] data, UInt32 seed)
FILE: RaptorDB.Common/NetworkClient.cs
class NetworkClient (line 17) | public class NetworkClient
class Config (line 19) | public static class Config
method NetworkClient (line 39) | public NetworkClient(string server, int port)
method Connect (line 52) | public void Connect()
method Send (line 59) | public object Send(object data)
method CheckConnection (line 107) | private void CheckConnection()
method Close (line 115) | public void Close()
class NetworkServer (line 124) | public class NetworkServer
method Start (line 134) | public void Start(int port, ProcessPayload handler)
method Run (line 146) | private void Run()
method t_Elapsed (line 162) | void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
method Stop (line 169) | public void Stop()
method Accept (line 174) | void Accept(TcpClient client)
FILE: RaptorDB.Common/Packets.cs
class Packet (line 5) | public class Packet
method Packet (line 7) | public Packet()
class ReturnPacket (line 26) | public class ReturnPacket
method ReturnPacket (line 28) | public ReturnPacket()
method ReturnPacket (line 32) | public ReturnPacket(bool ok)
method ReturnPacket (line 36) | public ReturnPacket(bool ok, string err)
FILE: RaptorDB.Common/RaptorDBClient.cs
class KVHF (line 10) | public class KVHF : IKeyStoreHF
method KVHF (line 12) | public KVHF(NetworkClient client, string username, string password)
method GetObjectHF (line 24) | public object GetObjectHF(string key)
method SetObjectHF (line 36) | public bool SetObjectHF(string key, object obj)
method DeleteKeyHF (line 46) | public bool DeleteKeyHF(string key)
method CountHF (line 56) | public int CountHF()
method ContainsHF (line 65) | public bool ContainsHF(string key)
method GetKeysHF (line 75) | public string[] GetKeysHF()
method CompactStorageHF (line 84) | public void CompactStorageHF()
method CreatePacket (line 93) | private Packet CreatePacket()
method Increment (line 102) | public int Increment(string key, int amount)
method Decrement (line 112) | public int Decrement(string key, int amount)
method Increment (line 122) | public decimal Increment(string key, decimal amount)
method Decrement (line 132) | public decimal Decrement(string key, decimal amount)
class RaptorDBClient (line 143) | public class RaptorDBClient : IRaptorDB
method RaptorDBClient (line 145) | public RaptorDBClient(string server, int port, string username, string...
method Save (line 169) | public bool Save<T>(Guid docID, T document)
method SaveBytes (line 185) | public bool SaveBytes(Guid fileID, byte[] bytes)
method Query (line 201) | public Result<object> Query(string viewname)
method Query (line 212) | public Result<object> Query(string viewname, string filter)
method Fetch (line 222) | public object Fetch(Guid docID)
method FetchBytes (line 239) | public byte[] FetchBytes(Guid fileID)
method Shutdown (line 254) | public void Shutdown()
method Backup (line 272) | public bool Backup()
method Restore (line 283) | public void Restore()
method Delete (line 295) | public bool Delete(Guid docid)
method DeleteBytes (line 309) | public bool DeleteBytes(Guid fileid)
method AddUser (line 325) | public bool AddUser(string username, string oldpassword, string newpas...
method ServerSide (line 340) | public object[] ServerSide(ServerSideFunc func, string filter)
method ServerSide (line 359) | public object[] ServerSide<TRowSchema>(ServerSideFunc func, Expression...
method FullTextSearch (line 379) | public int[] FullTextSearch(string filter)
method CreatePacket (line 389) | private Packet CreatePacket()
method Query (line 405) | public Result<object> Query(string viewname, int start, int count)
method Query (line 418) | public Result<object> Query(string viewname, string filter, int start,...
method Query (line 461) | public Result<object> Query<TRowSchema>(string viewname, Expression<Pr...
method Count (line 481) | public int Count(string viewname)
method Count (line 492) | public int Count(string viewname, string filter)
method Query (line 508) | public Result<TRowSchema> Query<TRowSchema>(Expression<Predicate<TRowS...
method Query (line 521) | public Result<TRowSchema> Query<TRowSchema>(Expression<Predicate<TRowS...
method GenericResult (line 536) | private static Result<TRowSchema> GenericResult<TRowSchema>(Result<obj...
method Query (line 560) | public Result<TRowSchema> Query<TRowSchema>(string filter)
method Query (line 573) | public Result<TRowSchema> Query<TRowSchema>(string filter, int start, ...
method Count (line 592) | public int Count<TRowSchema>(Expression<Predicate<TRowSchema>> filter)
method FetchHistory (line 609) | public int[] FetchHistory(Guid docid)
method FetchBytesHistory (line 624) | public int[] FetchBytesHistory(Guid fileid)
method FetchVersion (line 639) | public object FetchVersion(int versionNumber)
method FetchBytesVersion (line 653) | public byte[] FetchBytesVersion(int versionNumber)
method Query (line 670) | public Result<object> Query(string viewname, string filter, int start,...
method Query (line 684) | public Result<object> Query<TRowSchema>(string viewname, Expression<Pr...
method Query (line 697) | public Result<TRowSchema> Query<TRowSchema>(Expression<Predicate<TRowS...
method Query (line 710) | public Result<TRowSchema> Query<TRowSchema>(string filter, int start, ...
method FetchHistoryInfo (line 720) | public HistoryInfo[] FetchHistoryInfo(Guid docid)
method FetchBytesHistoryInfo (line 734) | public HistoryInfo[] FetchBytesHistoryInfo(Guid docid)
method ViewDelete (line 749) | public int ViewDelete<TRowSchema>(Expression<Predicate<TRowSchema>> fi...
method ViewDelete (line 766) | public int ViewDelete(string viewname, string filter)
method ViewInsert (line 782) | public bool ViewInsert<TRowSchema>(Guid id, TRowSchema row)
method ViewInsert (line 799) | public bool ViewInsert(string viewname, Guid id, object row)
method DocumentCount (line 813) | public long DocumentCount()
method GetKVHF (line 821) | public IKeyStoreHF GetKVHF()
method ServerSide (line 826) | public object[] ServerSide(ServerSideFuncWithArgs func, string filter,...
method ServerSide (line 839) | public object[] ServerSide<TRowSchema>(ServerSideFuncWithArgs func, Ex...
method Fetch (line 855) | public T Fetch<T>(Guid docID) where T : class
method FreeMemory (line 867) | public void FreeMemory()
method SaveToDocsOnViewInsert (line 874) | public void SaveToDocsOnViewInsert(bool yes)
FILE: RaptorDB.Common/SafeDictionary.cs
type IKV (line 10) | public interface IKV<T, V>
method TryGetValue (line 12) | bool TryGetValue(T key, out V val);
method Count (line 13) | int Count();
method GetEnumerator (line 14) | IEnumerator<KeyValuePair<T, V>> GetEnumerator();
method Add (line 15) | void Add(T key, V value);
method Keys (line 16) | T[] Keys();
method Remove (line 17) | bool Remove(T key);
method Clear (line 18) | void Clear();
method GetValue (line 19) | V GetValue(T key);
class ReferenceEqualityComparer (line 25) | public class ReferenceEqualityComparer : IEqualityComparer, IEqualityCom...
method Equals (line 29) | public new bool Equals(object x, object y) => x.Equals(y);
method GetHashCode (line 30) | public int GetHashCode(object obj) => RuntimeHelpers.GetHashCode(obj);
class SafeDictionary (line 33) | public class SafeDictionary<TKey, TValue> : IKV<TKey, TValue>
method SafeDictionary (line 38) | public SafeDictionary(int capacity)
method SafeDictionary (line 43) | public SafeDictionary()
method TryGetValue (line 48) | public bool TryGetValue(TKey key, out TValue value)
method Count (line 68) | public int Count()
method GetEnumerator (line 73) | public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
method Add (line 78) | public void Add(TKey key, TValue value)
method Keys (line 89) | public TKey[] Keys()
method Remove (line 99) | public bool Remove(TKey key)
method Clear (line 109) | public void Clear()
method GetValue (line 115) | public TValue GetValue(TKey key)
class SafeSortedList (line 122) | public class SafeSortedList<T, V> : IKV<T, V>
method Count (line 127) | public int Count()
method Add (line 132) | public void Add(T key, V val)
method Remove (line 143) | public bool Remove(T key)
method GetKey (line 151) | public T GetKey(int index)
method GetValue (line 160) | public V GetValue(int index)
method Keys (line 169) | public T[] Keys()
method GetEnumerator (line 193) | public IEnumerator<KeyValuePair<T, V>> GetEnumerator()
method TryGetValue (line 198) | public bool TryGetValue(T key, out V value)
method Clear (line 204) | public void Clear()
method GetValue (line 210) | public V GetValue(T key)
class FastDateTime (line 218) | public static class FastDateTime
method FastDateTime (line 228) | static FastDateTime()
method CompareMemCmp (line 238) | public static int CompareMemCmp(byte[] left, byte[] right)
method memcmp (line 246) | [DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
method ToInt32 (line 249) | public static int ToInt32(byte[] value, int startIndex, bool reverse)
method ToInt32 (line 262) | public static unsafe int ToInt32(byte[] value, int startIndex)
method ToInt64 (line 270) | public static long ToInt64(byte[] value, int startIndex, bool reverse)
method ToInt64 (line 282) | public static unsafe long ToInt64(byte[] value, int startIndex)
method ToInt16 (line 290) | public static short ToInt16(byte[] value, int startIndex, bool reverse)
method ToInt16 (line 302) | public static unsafe short ToInt16(byte[] value, int startIndex)
FILE: RaptorDB.Common/View.cs
class ViewBase (line 7) | public abstract class ViewBase
class View (line 83) | public class View<T> : ViewBase
method View (line 85) | public View()
method Verify (line 104) | public Result<object> Verify()
FILE: RaptorDB.Common/ZipStorer.cs
class ZIP (line 13) | public static class ZIP
method Main (line 16) | static void Main(string[] args)
method log (line 47) | private static void log(string msg)
method printhelp (line 52) | private static void printhelp()
method Compress (line 60) | public static void Compress(string filename, string folder, bool recur...
method Decompress (line 84) | public static void Decompress(string filename, string outputfolder, Ac...
method docompressdirectory (line 109) | private static void docompressdirectory(ZipStorer zip, string dir, str...
class ZipStorer (line 127) | public class ZipStorer : IDisposable
type Compression (line 132) | public enum Compression : ushort
type ZipFileEntry (line 143) | public struct ZipFileEntry
method ToString (line 170) | public override string ToString()
method ZipStorer (line 206) | static ZipStorer()
method Create (line 229) | public static ZipStorer Create(string _filename, string _comment)
method Create (line 245) | public static ZipStorer Create(Stream _stream, string _comment)
method Open (line 260) | public static ZipStorer Open(string _filename, FileAccess _access)
method Open (line 275) | public static ZipStorer Open(Stream _stream, FileAccess _access)
method AddFile (line 297) | public void AddFile(Compression _method, string _pathname, string _fil...
method AddFile (line 307) | public void AddFile(Compression _method, string _pathname, string _fil...
method AddStream (line 324) | public void AddStream(Compression _method, string _filenameInZip, Stre...
method Close (line 366) | public void Close()
method ReadCentralDir (line 400) | public List<ZipFileEntry> ReadCentralDir()
method ExtractFile (line 453) | public bool ExtractFile(ZipFileEntry _zfe, string _filename)
method ExtractFile2 (line 474) | public bool ExtractFile2(ZipFileEntry _zfe, string _filename)
method ExtractFile (line 502) | public bool ExtractFile(ZipFileEntry _zfe, Stream _stream)
method RemoveEntries (line 546) | public static bool RemoveEntries(ref ZipStorer _zip, List<ZipFileEntry...
method GetFileOffset (line 598) | private uint GetFileOffset(uint _headerOffset)
method WriteLocalHeader (line 626) | private void WriteLocalHeader(ref ZipFileEntry _zfe)
method WriteCentralDirRecord (line 666) | private void WriteCentralDirRecord(ZipFileEntry _zfe)
method WriteEndRecord (line 708) | private void WriteEndRecord(uint _size, uint _offset)
method Store (line 722) | private void Store(ref ZipFileEntry _zfe, Stream _source)
method DateTimeToDosTime (line 783) | private uint DateTimeToDosTime(DateTime _dt)
method DosTimeToDateTime (line 789) | private DateTime DosTimeToDateTime(uint _dt)
method UpdateCrcAndSizes (line 812) | private void UpdateCrcAndSizes(ref ZipFileEntry _zfe)
method NormalizedFilename (line 827) | private string NormalizedFilename(string _filename)
method ReadFileInfo (line 838) | private bool ReadFileInfo()
method Dispose (line 886) | public void Dispose()
FILE: RaptorDB.Common/fastBinaryJSON/BJSON.cs
class TOKENS (line 13) | public sealed class TOKENS
class typedarray (line 49) | public class typedarray
class BJSONParameters (line 58) | public sealed class BJSONParameters
method FixValues (line 115) | public void FixValues()
method MakeCopy (line 124) | internal BJSONParameters MakeCopy()
class BJSON (line 147) | public static class BJSON
method Parse (line 158) | public static object Parse(byte[] json)
method ToDynamic (line 168) | public static dynamic ToDynamic(byte[] json)
method RegisterCustomType (line 179) | public static void RegisterCustomType(Type type, Reflection.Serialize ...
method ToBJSON (line 188) | public static byte[] ToBJSON(object obj)
method ToBJSON (line 198) | public static byte[] ToBJSON(object obj, BJSONParameters param)
method FillObject (line 220) | public static object FillObject(object input, byte[] json)
method ToObject (line 230) | public static T ToObject<T>(byte[] json)
method ToObject (line 241) | public static T ToObject<T>(byte[] json, BJSONParameters param)
method ToObject (line 250) | public static object ToObject(byte[] json)
method ToObject (line 260) | public static object ToObject(byte[] json, BJSONParameters param)
method ToObject (line 272) | public static object ToObject(byte[] json, Type type)
method ClearReflectionCache (line 279) | public static void ClearReflectionCache()
method DeepCopy (line 288) | public static object DeepCopy(object obj)
class deserializer (line 294) | internal class deserializer
method deserializer (line 296) | public deserializer(BJSONParameters param)
method ToObject (line 306) | public T ToObject<T>(byte[] json)
method ToObject (line 311) | public object ToObject(byte[] json)
method ToObject (line 316) | public object ToObject(byte[] json, Type type)
method ChangeType (line 378) | private object ChangeType(object o, Type type)
method FillObject (line 386) | public object FillObject(object input, byte[] json)
method RootHashTable (line 394) | private object RootHashTable(List<object> o)
method RootList (line 414) | private object RootList(object parse, Type type)
method RootDictionary (line 434) | private object RootDictionary(object parse, Type type)
method ParseDictionary (line 485) | private object ParseDictionary(Dictionary<string, object> d, Dictionar...
method ParseTypedArray (line 628) | private object ParseTypedArray(Dictionary<string, object> globaltypes, o...
method CreateSD (line 654) | private StringDictionary CreateSD(Dictionary<string, object> d)
method CreateNV (line 664) | private NameValueCollection CreateNV(Dictionary<string, object> d)
method CreateEnum (line 674) | private object CreateEnum(Type pt, object v)
method CreateArray (line 684) | private object CreateArray(List<object> data, Type pt, Type bt, Dictiona...
method CreateGenericList (line 710) | private object CreateGenericList(List<object> data, Type pt, Type bt, Di...
method CreateStringKeyDictionary (line 738) | private object CreateStringKeyDictionary(Dictionary<string, object> read...
method CreateDictionary (line 779) | private object CreateDictionary(List<object> reader, Type pt, Type[] typ...
method CreateDataset (line 811) | private DataSet CreateDataset(Dictionary<string, object> reader, Diction...
method ReadDataTable (line 853) | private void ReadDataTable(List<object> rows, DataTable dt)
method CreateDataTable (line 869) | DataTable CreateDataTable(Dictionary<string, object> reader, Dictionary<...
FILE: RaptorDB.Common/fastBinaryJSON/BJsonParser.cs
class BJsonParser (line 7) | internal sealed class BJsonParser
method BJsonParser (line 14) | internal BJsonParser(byte[] json, bool useUTC, bool v1_4TA)
method Decode (line 21) | public object Decode()
method ParseObject (line 27) | private Dictionary<string, object> ParseObject()
method readkeyvalue (line 56) | private bool readkeyvalue(Dictionary<string, object> dic, ref byte t)
method ParseName2 (line 79) | private string ParseName2() // unicode byte len string -> <128 len chars
method ParseName (line 87) | private string ParseName()
method ParseArray (line 95) | private List<object> ParseArray()
method ParseValue (line 119) | private object ParseValue(out bool breakparse)
method ParsTimeSpan (line 186) | private TimeSpan ParsTimeSpan()
method ParseTypedArray (line 196) | private object ParseTypedArray(byte token)
method ParseNameLong (line 231) | private string ParseNameLong() // unicode short len string -> <32k chars
method ParseChar (line 240) | private object ParseChar()
method ParseGuid (line 247) | private Guid ParseGuid()
method ParseFloat (line 255) | private float ParseFloat()
method ParseUShort (line 262) | private ushort ParseUShort()
method ParseULong (line 269) | private ulong ParseULong()
method ParseUint (line 276) | private uint ParseUint()
method ParseShort (line 283) | private short ParseShort()
method ParseLong (line 290) | private long ParseLong()
method ParseInt (line 297) | private int ParseInt()
method ParseDouble (line 304) | private double ParseDouble()
method ParseUnicodeString (line 311) | private object ParseUnicodeString()
method ParseString (line 321) | private string ParseString()
method ParseDecimal (line 331) | private decimal ParseDecimal()
method ParseDateTime (line 346) | private DateTime ParseDateTime()
method ParseByteArray (line 358) | private byte[] ParseByteArray()
method ParseByte (line 368) | private byte ParseByte()
method GetToken (line 373) | private byte GetToken()
FILE: RaptorDB.Common/fastBinaryJSON/BJsonSerializer.cs
class BJSONSerializer (line 13) | internal sealed class BJSONSerializer : IDisposable
method Dispose (line 24) | private void Dispose(bool disposing)
method Dispose (line 35) | public void Dispose()
method BJSONSerializer (line 41) | internal BJSONSerializer(BJSONParameters param)
method ConvertToBJSON (line 47) | internal byte[] ConvertToBJSON(object obj)
method WriteTypes (line 68) | private void WriteTypes(Dictionary<string, int> dic)
method WriteValue (line 85) | private void WriteValue(object obj)
method WriteSByte (line 182) | private void WriteSByte(sbyte p)
method WriteTimeSpan (line 189) | private void WriteTimeSpan(TimeSpan obj)
method WriteTypedArray (line 196) | private void WriteTypedArray(ICollection array)
method WriteNV (line 242) | private void WriteNV(NameValueCollection nameValueCollection)
method WriteSD (line 259) | private void WriteSD(StringDictionary stringDictionary)
method WriteUShort (line 276) | private void WriteUShort(ushort p)
method WriteShort (line 282) | private void WriteShort(short p)
method WriteFloat (line 288) | private void WriteFloat(float p)
method WriteDouble (line 295) | private void WriteDouble(double p)
method WriteByte (line 302) | private void WriteByte(byte p)
method WriteDecimal (line 308) | private void WriteDecimal(decimal p)
method WriteULong (line 316) | private void WriteULong(ulong p)
method WriteUInt (line 322) | private void WriteUInt(uint p)
method WriteLong (line 328) | private void WriteLong(long p)
method WriteChar (line 334) | private void WriteChar(char p)
method WriteBytes (line 340) | private void WriteBytes(byte[] p)
method WriteBool (line 347) | private void WriteBool(bool p)
method WriteNull (line 355) | private void WriteNull()
method WriteCustom (line 361) | private void WriteCustom(object obj)
method WriteColon (line 368) | private void WriteColon()
method WriteComma (line 373) | private void WriteComma()
method WriteEnum (line 378) | private void WriteEnum(Enum e)
method WriteInt (line 383) | private void WriteInt(int i)
method WriteGuid (line 389) | private void WriteGuid(Guid g)
method WriteDateTime (line 395) | private void WriteDateTime(DateTime dateTime)
method GetSchema (line 407) | private DatasetSchema GetSchema(DataTable ds)
method GetSchema (line 426) | private DatasetSchema GetSchema(DataSet ds)
method GetXmlSchema (line 448) | private string GetXmlSchema(DataTable dt)
method WriteDataset (line 457) | private void WriteDataset(DataSet ds)
method WriteDataTableData (line 475) | private void WriteDataTableData(DataTable table)
method WriteDataTable (line 501) | void WriteDataTable(DataTable dt)
method WriteObject (line 518) | private void WriteObject(object obj)
method WritePairFast (line 600) | private void WritePairFast(string name, string value)
method WritePair (line 611) | private void WritePair(string name, object value)
method WriteArray (line 622) | private void WriteArray(IEnumerable array)
method WriteStringDictionary (line 639) | private void WriteStringDictionary(IDictionary dic)
method WriteStringDictionary (line 656) | private void WriteStringDictionary(IDictionary<string, object> dic)
method WriteDictionary (line 673) | private void WriteDictionary(IDictionary dic)
method WriteName (line 693) | private void WriteName(string s)
method WriteString (line 710) | private void WriteString(string s)
FILE: RaptorDB.Common/fastBinaryJSON/Helper.cs
method ToInt32 (line 10) | internal static unsafe int ToInt32(byte[] value, int startIndex, bool re...
method ToInt32 (line 23) | internal static unsafe int ToInt32(byte[] value, int startIndex)
method ToInt64 (line 31) | internal static unsafe long ToInt64(byte[] value, int startIndex, bool r...
method ToInt64 (line 43) | internal static unsafe long ToInt64(byte[] value, int startIndex)
method ToInt16 (line 51) | internal static unsafe short ToInt16(byte[] value, int startIndex, bool ...
method ToInt16 (line 63) | internal static unsafe short ToInt16(byte[] value, int startIndex)
method GetBytes (line 71) | internal static unsafe byte[] GetBytes(long num, bool reverse)
FILE: RaptorDB.Common/fastBinaryJSON/dynamic.cs
class DynamicJson (line 9) | internal class DynamicJson : DynamicObject, IEnumerable
method DynamicJson (line 14) | public DynamicJson(byte[] json)
method DynamicJson (line 26) | private DynamicJson(object dictionary)
method TryGetIndex (line 32) | public override bool TryGetIndex(GetIndexBinder binder, Object[] index...
method TryGetMember (line 48) | public override bool TryGetMember(GetMemberBinder binder, out object r...
method GetEnumerator (line 74) | public IEnumerator GetEnumerator()
FILE: RaptorDB.Common/fastJSON/Formatter.cs
class Formatter (line 5) | internal static class Formatter
method AppendIndent (line 9) | private static void AppendIndent(StringBuilder sb, int count, string i...
method PrettyPrint (line 14) | public static string PrettyPrint(string input)
method PrettyPrint (line 19) | public static string PrettyPrint(string input, string spaces)
FILE: RaptorDB.Common/fastJSON/Getters.cs
class DatasetSchema (line 5) | public sealed class DatasetSchema
FILE: RaptorDB.Common/fastJSON/Helper.cs
class Helper (line 12) | class Helper
method IsNullable (line 14) | public static bool IsNullable(Type t)
method UnderlyingTypeOf (line 21) | public static Type UnderlyingTypeOf(Type t)
method CreateDateTimeOffset (line 26) | public static DateTimeOffset CreateDateTimeOffset(int year, int month,...
method BoolConv (line 36) | public static bool BoolConv(object v)
method AutoConv (line 54) | public static long AutoConv(object value, JSONParameters param)
method CreateLong (line 72) | public static long CreateLong(string s, int index, int count)
method CreateLong (line 118) | public static long CreateLong(char[] s, int index, int count)
method CreateInteger (line 164) | public static int CreateInteger(string s, int index, int count)
method CreateEnum (line 210) | public static object CreateEnum(Type pt, object v)
method CreateGuid (line 220) | public static Guid CreateGuid(string s)
method CreateSD (line 228) | public static StringDictionary CreateSD(Dictionary<string, object> d)
method CreateNV (line 238) | public static NameValueCollection CreateNV(Dictionary<string, object> d)
method CreateDateTimeOffset (line 248) | public static object CreateDateTimeOffset(string value)
method CreateDateTime (line 307) | public static DateTime CreateDateTime(string value, bool UseUTCDateTime)
FILE: RaptorDB.Common/fastJSON/JSON.cs
class JSONParameters (line 17) | public sealed class JSONParameters
method FixValues (line 119) | public void FixValues()
method MakeCopy (line 130) | public JSONParameters MakeCopy()
class JSON (line 161) | public static class JSON
method ToNiceJSON (line 172) | public static string ToNiceJSON(object obj)
method ToNiceJSON (line 184) | public static string ToNiceJSON(object obj, JSONParameters param)
method ToJSON (line 195) | public static string ToJSON(object obj)
method ToJSON (line 205) | public static string ToJSON(object obj, JSONParameters param)
method Parse (line 228) | public static object Parse(string json)
method ToDynamic (line 238) | public static dynamic ToDynamic(string json)
method ToObject (line 249) | public static T ToObject<T>(string json)
method ToObject (line 260) | public static T ToObject<T>(string json, JSONParameters param)
method ToObject (line 269) | public static object ToObject(string json)
method ToObject (line 279) | public static object ToObject(string json, JSONParameters param)
method ToObject (line 289) | public static object ToObject(string json, Type type)
method ToObject (line 300) | public static object ToObject(string json, Type type, JSONParameters par)
method FillObject (line 310) | public static object FillObject(object input, string json)
method DeepCopy (line 321) | public static object DeepCopy(object obj)
method DeepCopy (line 331) | public static T DeepCopy<T>(T obj)
method Beautify (line 341) | public static string Beautify(string input)
method Beautify (line 352) | public static string Beautify(string input, byte spaces)
method RegisterCustomType (line 363) | public static void RegisterCustomType(Type type, Reflection.Serialize ...
method ClearReflectionCache (line 370) | public static void ClearReflectionCache()
class deserializer (line 376) | internal class deserializer
method deserializer (line 378) | public deserializer(JSONParameters param)
method ToObject (line 393) | public T ToObject<T>(string json)
method ToObject (line 413) | public object ToObject(string json)
method ToObject (line 418) | public object ToObject(string json, Type type)
method RootHashTable (line 482) | private object RootHashTable(List<object> o)
method ChangeType (line 502) | private object ChangeType(object value, Type conversionType)
method RootList (line 561) | private object RootList(object parse, Type type)
method DoParseList (line 569) | private void DoParseList(IList parse, Type it, IList o)
method RootArray (line 587) | private object RootArray(object parse, Type type)
method RootDictionary (line 598) | private object RootDictionary(object parse, Type type)
method ParseDictionary (line 648) | internal object ParseDictionary(Dictionary<string, object> d, Dictiona...
method ProcessMap (line 790) | private static void ProcessMap(object obj, Dictionary<string, myPropIn...
method CreateArray (line 802) | private object CreateArray(List<object> data, Type pt, Type bt, Dictio...
method CreateGenericList (line 828) | private object CreateGenericList(List<object> data, Type pt, Type bt, ...
method CreateStringKeyDictionary (line 855) | private object CreateStringKeyDictionary(Dictionary<string, object> re...
method CreateDictionary (line 896) | private object CreateDictionary(List<object> reader, Type pt, Type[] t...
method CreateDataset (line 949) | private DataSet CreateDataset(Dictionary<string, object> reader, Dicti...
method ReadDataTable (line 991) | private void ReadDataTable(List<object> rows, DataTable dt)
method CreateDataTable (line 1041) | DataTable CreateDataTable(Dictionary<string, object> reader, Dictionar...
FILE: RaptorDB.Common/fastJSON/JsonParser.cs
class JsonParser (line 13) | internal sealed class JsonParser
type Token (line 15) | enum Token
method JsonParser (line 39) | internal JsonParser(string json, bool AllowNonQuotedKeys)
method Decode (line 46) | public unsafe object Decode()
method ParseObject (line 52) | private unsafe Dictionary<string, object> ParseObject(char* p)
method ParseArray (line 94) | private unsafe List<object> ParseArray(char* p)
method ParseValue (line 118) | private unsafe object ParseValue(char* p, bool val)
method ParseString (line 150) | private unsafe string ParseString(char* p, bool val)
method ParseSingleChar (line 258) | private uint ParseSingleChar(char c1, uint multipliyer)
method ParseUnicode (line 270) | private uint ParseUnicode(char c1, char c2, char c3, char c4)
method ParseNumber (line 280) | private unsafe object ParseNumber(char* p)
method LookAhead (line 321) | private unsafe Token LookAhead(char* p)
method ConsumeToken (line 328) | private void ConsumeToken()
method NextToken (line 333) | private unsafe Token NextToken(char* p)
method NextTokenCore (line 342) | private unsafe Token NextTokenCore(char* p)
method UnsafeSubstring (line 463) | private static unsafe string UnsafeSubstring(//char[] source,
FILE: RaptorDB.Common/fastJSON/JsonSerializer.cs
class JSONSerializer (line 15) | internal sealed class JSONSerializer
method JSONSerializer (line 27) | internal JSONSerializer(JSONParameters param)
method ConvertToJSON (line 38) | internal string ConvertToJSON(object obj)
method WriteValue (line 63) | private void WriteValue(object obj)
method WriteDateTimeOffset (line 166) | private void WriteDateTimeOffset(DateTimeOffset d)
method WriteNV (line 192) | private void WriteNV(NameValueCollection nameValueCollection)
method WriteSD (line 216) | private void WriteSD(StringDictionary stringDictionary)
method WriteCustom (line 242) | private void WriteCustom(object obj)
method WriteEnum (line 249) | private void WriteEnum(Enum e)
method WriteGuid (line 258) | private void WriteGuid(Guid g)
method WriteBytes (line 266) | private void WriteBytes(byte[] bytes)
method WriteDateTime (line 275) | private void WriteDateTime(DateTime dateTime)
method write_date_value (line 296) | private void write_date_value(DateTime dt)
method GetSchema (line 313) | private DatasetSchema GetSchema(DataTable ds)
method GetSchema (line 332) | private DatasetSchema GetSchema(DataSet ds)
method GetXmlSchema (line 354) | private string GetXmlSchema(DataTable dt)
method WriteDataset (line 363) | private void WriteDataset(DataSet ds)
method WriteDataTableData (line 382) | private void WriteDataTableData(DataTable table)
method WriteDataTable (line 408) | void WriteDataTable(DataTable dt)
method WriteObject (line 425) | private void WriteObject(object obj)
method WritePairFast (line 521) | private void WritePairFast(string name, string value)
method WritePair (line 530) | private void WritePair(string name, object value)
method WriteArray (line 539) | private void WriteArray(IEnumerable array)
method WriteStringDictionary (line 556) | private void WriteStringDictionary(IDictionary dic)
method WriteStringDictionary (line 582) | private void WriteStringDictionary(IEnumerable<KeyValuePair<string, ob...
method WriteDictionary (line 606) | private void WriteDictionary(IDictionary dic)
method WriteStringFast (line 626) | private void WriteStringFast(string s)
method WriteString (line 633) | private void WriteString(string s)
FILE: RaptorDB.Common/fastJSON/Reflection.cs
type Getters (line 19) | public struct Getters
type myPropInfoType (line 28) | public enum myPropInfoType
class myPropInfo (line 53) | public class myPropInfo
class Reflection (line 75) | public sealed class Reflection
method Reflection (line 81) | static Reflection()
method Reflection (line 84) | private Reflection()
method TryGetOpCode (line 118) | private static bool TryGetOpCode(short code, out OpCode opCode)
method UTF8GetBytes (line 139) | public static byte[] UTF8GetBytes(string str)
method UTF8GetString (line 144) | public static string UTF8GetString(byte[] bytes, int offset, int len)
method UnicodeGetBytes (line 149) | public unsafe static byte[] UnicodeGetBytes(string str)
method UnicodeGetString (line 160) | public static string UnicodeGetString(byte[] b)
method UnicodeGetString (line 165) | public unsafe static string UnicodeGetString(byte[] bytes, int offset,...
method CreateCustom (line 182) | internal object CreateCustom(string v, Type type)
method RegisterCustomType (line 189) | internal void RegisterCustomType(Type type, Serialize serializer, Dese...
method IsTypeRegistered (line 200) | internal bool IsTypeRegistered(Type t)
method GetGenericTypeDefinition (line 209) | public Type GetGenericTypeDefinition(Type t)
method GetGenericArguments (line 222) | public Type[] GetGenericArguments(Type t)
method Getproperties (line 235) | public Dictionary<string, myPropInfo> Getproperties(Type type, string ...
method CreateMyProp (line 309) | private myPropInfo CreateMyProp(Type t, string name)
method GetChangeType (line 367) | private Type GetChangeType(Type conversionType)
method GetTypeAssemblyName (line 377) | public string GetTypeAssemblyName(Type t)
method GetTypeFromCache (line 390) | internal Type GetTypeFromCache(string typename, bool blacklistChecking)
method FastCreateList (line 423) | internal object FastCreateList(Type objtype, int capacity)
method FastCreateInstance (line 466) | internal object FastCreateInstance(Type objtype)
method CreateSetField (line 509) | internal static GenericSetter CreateSetField(Type type, FieldInfo fiel...
method GetGetterBackingField (line 548) | internal static FieldInfo GetGetterBackingField(PropertyInfo autoPrope...
method CreateSetMethod (line 588) | internal static GenericSetter CreateSetMethod(Type type, PropertyInfo ...
method CreateGetField (line 652) | internal static GenericGetter CreateGetField(Type type, FieldInfo fiel...
method CreateGetMethod (line 682) | internal static GenericGetter CreateGetMethod(Type type, PropertyInfo ...
method GetGetters (line 723) | public Getters[] GetGetters(Type type, /*bool ShowReadOnlyProperties,*...
method ResetPropertyCache (line 842) | internal void ResetPropertyCache()
method ClearReflectionCache (line 847) | internal void ClearReflectionCache()
FILE: RaptorDB.Common/fastJSON/dynamic.cs
class DynamicJson (line 10) | internal class DynamicJson : DynamicObject, IEnumerable
method DynamicJson (line 15) | public DynamicJson(string json)
method DynamicJson (line 25) | private DynamicJson(object dictionary)
method GetDynamicMemberNames (line 31) | public override IEnumerable<string> GetDynamicMemberNames()
method TryGetIndex (line 36) | public override bool TryGetIndex(GetIndexBinder binder, Object[] index...
method TryGetMember (line 52) | public override bool TryGetMember(GetMemberBinder binder, out object r...
method GetEnumerator (line 78) | IEnumerator IEnumerable.GetEnumerator()
FILE: RaptorDB/DataTypes/DataTypes.cs
class View_delete (line 9) | internal class View_delete
class View_insert (line 16) | internal class View_insert
class FullTextString (line 23) | internal class FullTextString
class NoIndexing (line 28) | internal class NoIndexing
type IRowFiller (line 33) | public interface IRowFiller
method FillRow (line 35) | object FillRow(object row, object[] data);
type IGetBytes (line 38) | internal interface IGetBytes<T>
method GetBytes (line 40) | byte[] GetBytes(T obj);
method GetObject (line 41) | T GetObject(byte[] buffer, int offset, int count);
class RDBDataType (line 44) | internal class RDBDataType<T>
method ByteHandler (line 46) | public static IGetBytes<T> ByteHandler()
method GetByteSize (line 66) | public static byte GetByteSize(byte keysize)
method GetEmpty (line 86) | internal static object GetEmpty()
class double_handler (line 99) | internal class double_handler<T> : IGetBytes<double>
method GetBytes (line 101) | public byte[] GetBytes(double obj)
method GetObject (line 106) | public double GetObject(byte[] buffer, int offset, int count)
class byte_handler (line 112) | internal class byte_handler<T> : IGetBytes<byte>
method GetBytes (line 114) | public byte[] GetBytes(byte obj)
method GetObject (line 119) | public byte GetObject(byte[] buffer, int offset, int count)
class float_handler (line 125) | internal class float_handler<T> : IGetBytes<float>
method GetBytes (line 127) | public byte[] GetBytes(float obj)
method GetObject (line 132) | public float GetObject(byte[] buffer, int offset, int count)
class decimal_handler (line 138) | internal class decimal_handler<T> : IGetBytes<decimal>
method GetBytes (line 140) | public byte[] GetBytes(decimal obj)
method GetObject (line 155) | public decimal GetObject(byte[] buffer, int offset, int count)
class ushort_handler (line 171) | internal class ushort_handler<T> : IGetBytes<ushort>
method GetBytes (line 173) | public byte[] GetBytes(ushort obj)
method GetObject (line 178) | public ushort GetObject(byte[] buffer, int offset, int count)
class short_handler (line 184) | internal class short_handler<T> : IGetBytes<short>
method GetBytes (line 186) | public byte[] GetBytes(short obj)
method GetObject (line 191) | public short GetObject(byte[] buffer, int offset, int count)
class string_handler (line 197) | internal class string_handler<T> : IGetBytes<string>
method GetBytes (line 199) | public byte[] GetBytes(string obj)
method GetObject (line 204) | public string GetObject(byte[] buffer, int offset, int count)
class int_handler (line 210) | internal class int_handler<T> : IGetBytes<int>
method GetBytes (line 212) | public byte[] GetBytes(int obj)
method GetObject (line 217) | public int GetObject(byte[] buffer, int offset, int count)
class uint_handler (line 223) | internal class uint_handler<T> : IGetBytes<uint>
method GetBytes (line 225) | public byte[] GetBytes(uint obj)
method GetObject (line 230) | public uint GetObject(byte[] buffer, int offset, int count)
class long_handler (line 236) | internal class long_handler<T> : IGetBytes<long>
method GetBytes (line 238) | public byte[] GetBytes(long obj)
method GetObject (line 243) | public long GetObject(byte[] buffer, int offset, int count)
class guid_handler (line 249) | internal class guid_handler<T> : IGetBytes<Guid>
method GetBytes (line 251) | public byte[] GetBytes(Guid obj)
method GetObject (line 256) | public Guid GetObject(byte[] buffer, int offset, int count)
class datetime_handler (line 264) | internal class datetime_handler<T> : IGetBytes<DateTime>
method GetBytes (line 266) | public byte[] GetBytes(DateTime obj)
method GetObject (line 271) | public DateTime GetObject(byte[] buffer, int offset, int count)
FILE: RaptorDB/Global.cs
class Global (line 3) | public class Global
FILE: RaptorDB/Helper/Container.cs
class BitmapContainer (line 8) | class BitmapContainer : Container
method BitmapContainer (line 10) | public BitmapContainer()
method BitmapContainer (line 14) | public BitmapContainer(int OneCount)
method BitmapContainer (line 38) | public BitmapContainer(bool allones)
method BitmapContainer (line 43) | public BitmapContainer(ulong[] vals)
method Values (line 54) | public ulong[] Values()
method CountOnes (line 65) | public override long CountOnes()
method CountZeros (line 86) | public override long CountZeros()
method GetBitIndexes (line 94) | public override IEnumerable<ushort> GetBitIndexes()
method Get (line 118) | public override bool Get(long offset)
method Set (line 139) | public override void Set(long offset, bool val)
method ChangeRequired (line 179) | public override bool ChangeRequired()
method ToBitmap (line 198) | public override Container ToBitmap()
method Change (line 203) | public override Container Change()
method Copy (line 227) | public override Container Copy()
method Not (line 238) | public override Container Not()
class OffsetContainer (line 260) | class OffsetContainer : Container
method OffsetContainer (line 262) | public OffsetContainer()
method OffsetContainer (line 266) | public OffsetContainer(IEnumerable<ushort> vals)
method Values (line 275) | public ushort[] Values()
method ToBitmap (line 281) | public override Container ToBitmap()
method Change (line 292) | public override Container Change()
method ChangeRequired (line 303) | public override bool ChangeRequired()
method Copy (line 314) | public override Container Copy()
method CountOnes (line 325) | public override long CountOnes()
method CountZeros (line 330) | public override long CountZeros()
method Get (line 335) | public override bool Get(long offset)
method GetBitIndexes (line 346) | public override IEnumerable<ushort> GetBitIndexes()
method Set (line 353) | public override void Set(long offset, bool val)
method Not (line 382) | public override Container Not()
class InvertedContainer (line 391) | class InvertedContainer : Container
method InvertedContainer (line 393) | public InvertedContainer()
method InvertedContainer (line 399) | public InvertedContainer(IEnumerable<ushort> vals)
method ToBitmap (line 411) | public override Container ToBitmap()
method Change (line 425) | public override Container Change()
method ChangeRequired (line 433) | public override bool ChangeRequired()
method Copy (line 441) | public override Container Copy()
method CountOnes (line 452) | public override long CountOnes()
method CountZeros (line 457) | public override long CountZeros()
method Get (line 462) | public override bool Get(long offset)
method GetBitIndexes (line 473) | public override IEnumerable<ushort> GetBitIndexes()
method Not (line 486) | public override Container Not()
method Set (line 491) | public override void Set(long offset, bool val)
method Values (line 522) | public ushort[] Values()
class Container (line 532) | public abstract class Container
method Set (line 537) | public abstract void Set(long offset, bool val);
method Get (line 538) | public abstract bool Get(long offset);
method CountOnes (line 539) | public abstract long CountOnes();
method CountZeros (line 540) | public abstract long CountZeros();
method GetBitIndexes (line 541) | public abstract IEnumerable<ushort> GetBitIndexes();
method ChangeRequired (line 542) | public abstract bool ChangeRequired();
method Change (line 543) | public abstract Container Change();
method ToBitmap (line 544) | public abstract Container ToBitmap();
method Copy (line 545) | public abstract Container Copy();
method Not (line 546) | public abstract Container Not();
method BitCount (line 551) | public static int BitCount(ulong x)
type CTYPE (line 560) | public enum CTYPE
class CData (line 568) | public class CData
class MGRBData (line 575) | public class MGRBData
FILE: RaptorDB/Helper/MGRB.cs
class MGRB (line 7) | public class MGRB
method MGRB (line 9) | public MGRB()
method MGRB (line 12) | internal MGRB(SafeSortedList<int, Container> containers) : this(contai...
method MGRB (line 15) | internal MGRB(SafeSortedList<int, Container> containers, long size)
method Set (line 37) | public void Set(long position, bool val)
method Get (line 63) | public bool Get(long position)
method And (line 75) | public MGRB And(MGRB B)
method Or (line 103) | public MGRB Or(MGRB B)
method AndNot (line 135) | public MGRB AndNot(MGRB b)
method Not (line 144) | public MGRB Not()
method Not (line 155) | public MGRB Not(long count)
method Fill (line 172) | public static MGRB Fill(long count)
method CountOnes (line 193) | public long CountOnes()
method CountZeros (line 204) | public long CountZeros()
method GetBitIndexes (line 211) | public IEnumerable<int> GetBitIndexes()
method Optimize (line 221) | public MGRB Optimize()
method Serialize (line 252) | public MGRBData Serialize()
method Deserialize (line 305) | public void Deserialize(MGRBData input)
method Copy (line 362) | public MGRB Copy()
method GetFirst (line 374) | public int GetFirst()
method LastContainerIdx (line 385) | private int LastContainerIdx()
method containerAND (line 393) | private static Container containerAND(Container ca, Container cb)
method containerOR (line 436) | private static Container containerOR(Container ca, Container cb)
method GetBytes (line 480) | private static unsafe byte[] GetBytes(ushort num, bool reverse)
FILE: RaptorDB/Helper/WAHBitarray2.cs
class WAHBitArray (line 7) | public class WAHBitArray
type TYPE (line 9) | public enum TYPE
method WAHBitArray (line 16) | public WAHBitArray()
method WAHBitArray (line 25) | public WAHBitArray(TYPE type, uint[] ints)
method Copy (line 59) | public WAHBitArray Copy()
method Get (line 68) | public bool Get(int index)
method Set (line 90) | public void Set(int index, bool val)
method And (line 159) | public WAHBitArray And(WAHBitArray op)
method AndNot (line 174) | public WAHBitArray AndNot(WAHBitArray op)
method Or (line 189) | public WAHBitArray Or(WAHBitArray op)
method Not (line 204) | public WAHBitArray Not(int size)
method Xor (line 230) | public WAHBitArray Xor(WAHBitArray op)
method BitCount (line 246) | private static int BitCount(uint n)
method CountOnes (line 254) | public long CountOnes()
method CountZeros (line 270) | public long CountZeros()
method FreeMemory (line 287) | public void FreeMemory()
method GetCompressed (line 303) | public uint[] GetCompressed(out TYPE type)
method GetBitIndexes (line 320) | public IEnumerable<int> GetBitIndexes()
method GetOffsets (line 348) | private uint[] GetOffsets()
method prelogic (line 360) | private void prelogic(WAHBitArray op, out uint[] left, out uint[] right)
method GetBitArray (line 382) | internal uint[] GetBitArray()
method UnpackOffsets (line 397) | private uint[] UnpackOffsets()
method ChangeTypeIfNeeded (line 419) | private void ChangeTypeIfNeeded()
method Resize (line 443) | private void Resize(int index)
method ResizeAsNeeded (line 462) | private static void ResizeAsNeeded(List<uint> list, int index)
method internalSet (line 470) | private void internalSet(int index, bool val)
method internalGet (line 483) | private bool internalGet(int index)
method CheckBitArray (line 495) | private void CheckBitArray()
method Take31Bits (line 511) | private static uint Take31Bits(uint[] data, int index)
method Compress (line 531) | private static uint[] Compress(uint[] data)
method FlushOnes (line 564) | private static void FlushOnes(List<uint> compressed, ref uint ones)
method FlushZeros (line 574) | private static void FlushZeros(List<uint> compressed, ref uint zeros)
method Write31Bits (line 584) | private static void Write31Bits(List<uint> list, int index, uint val)
method WriteOnes (line 601) | private void WriteOnes(List<uint> list, int index, uint count)
method Uncompress (line 651) | private void Uncompress()
method Fill (line 681) | internal static WAHBitArray Fill(int count)
method GetFirst (line 699) | internal int GetFirst()
FILE: RaptorDB/Indexes/BitmapIndex.cs
class BitmapIndex (line 9) | internal class BitmapIndex
method BitmapIndex (line 11) | public BitmapIndex(string path, string filename)
class L (line 26) | class L : IDisposable
method L (line 29) | public L(BitmapIndex sc)
method Dispose (line 34) | void IDisposable.Dispose()
method Shutdown (line 61) | public void Shutdown()
method GetFreeRecordNumber (line 71) | public int GetFreeRecordNumber()
method Commit (line 82) | public void Commit(bool freeMemory)
method SetDuplicate (line 115) | public void SetDuplicate(int bitmaprecno, int record)
method GetBitmap (line 128) | public MGRB GetBitmap(int recno)
method Optimize (line 137) | public void Optimize()
method FreeMemory (line 191) | internal void FreeMemory()
method ReadRecordOffset (line 214) | private long ReadRecordOffset(int recnum)
method Initialize (line 223) | private void Initialize()
method InternalShutdown (line 239) | private void InternalShutdown()
method Flush (line 269) | private void Flush()
method internalGetBitmap (line 294) | private MGRB internalGetBitmap(int recno)
method SaveBitmap (line 324) | private void SaveBitmap(int recno, MGRB bmp)
method SaveBitmapToFile (line 351) | private long SaveBitmapToFile(MGRB bmp)
method ReadBMPDataForOptimize (line 379) | private byte[] ReadBMPDataForOptimize(long offset)
method LoadBitmap (line 398) | private MGRB LoadBitmap(long offset)
method CheckInternalOP (line 423) | private void CheckInternalOP()
method Done (line 431) | private void Done()
FILE: RaptorDB/Indexes/Cache.cs
type OPERATION (line 6) | public enum OPERATION
class Document (line 13) | public class Document
method Document (line 20) | public Document()
method Document (line 24) | public Document(string filename, string text)
method ToString (line 36) | public override string ToString()
FILE: RaptorDB/Indexes/Hoot.cs
class Hoot (line 10) | public class Hoot
method Hoot (line 12) | public Hoot(string IndexPath, string FileName, bool DocMode) : this(In...
method Hoot (line 15) | public Hoot(string IndexPath, string FileName, bool DocMode, ITokenize...
method Save (line 73) | public void Save()
method Index (line 79) | public void Index(int recordnumber, string text)
method Query (line 85) | public MGRB Query(string filter, int maxsize)
method Index (line 91) | public int Index(Document doc, bool deleteold)
method FindRows (line 117) | public IEnumerable<int> FindRows(string filter)
method FindDocuments (line 125) | public IEnumerable<T> FindDocuments<T>(string filter)
method FindDocumentFileNames (line 141) | public IEnumerable<string> FindDocumentFileNames(string filter)
method RemoveDocument (line 157) | public void RemoveDocument(int number)
method RemoveDocument (line 163) | public bool RemoveDocument(string filename)
method IsIndexed (line 176) | public bool IsIndexed(string filename)
method OptimizeIndex (line 182) | public void OptimizeIndex()
method checkloaded (line 194) | private void checkloaded()
method ExecutionPlan (line 202) | private MGRB ExecutionPlan(string filter, int maxsize)
method DoBitOperation (line 292) | private static MGRB DoBitOperation(MGRB bits, MGRB c, OPERATION op, in...
method InternalSave (line 314) | private void InternalSave()
method LoadWords (line 348) | private void LoadWords()
method AddtoIndex (line 398) | private void AddtoIndex(int recnum, string text)
method Shutdown (line 441) | public void Shutdown()
method FreeMemory (line 470) | public void FreeMemory()
method Fetch (line 490) | public T Fetch<T>(int docnum)
FILE: RaptorDB/Indexes/IIndex.cs
type RDBExpression (line 3) | internal enum RDBExpression
type IIndex (line 15) | internal interface IIndex
method Set (line 17) | void Set(object key, int recnum);
method Query (line 18) | MGRB Query(object fromkey, object tokey, int maxsize);
method Query (line 19) | MGRB Query(RDBExpression ex, object from , int maxsize);
method FreeMemory (line 20) | void FreeMemory();
method Shutdown (line 21) | void Shutdown();
method SaveIndex (line 22) | void SaveIndex();
method GetKeys (line 23) | object[] GetKeys();
FILE: RaptorDB/Indexes/ITokenizer.cs
type ITokenizer (line 5) | public interface ITokenizer
method GenerateWordFreq (line 7) | Dictionary<string, int> GenerateWordFreq(string text);
FILE: RaptorDB/Indexes/IndexFile.cs
class IndexFile (line 10) | internal class IndexFile<T>
method IndexFile (line 46) | public IndexFile(string filename, byte maxKeySize)//, ushort pageNodeC...
method SetBitmapDuplicate (line 100) | public void SetBitmapDuplicate(int bitmaprec, int rec)
method GetBitmapDuplaicateFreeRecordNumber (line 105) | public int GetBitmapDuplaicateFreeRecordNumber()
method GetDuplicatesRecordNumbers (line 110) | public IEnumerable<int> GetDuplicatesRecordNumbers(int recno)
method GetDuplicateBitmap (line 115) | public MGRB GetDuplicateBitmap(int recno)
method CreateBlockHeader (line 120) | private byte[] CreateBlockHeader(byte type, ushort itemcount, int righ...
method CreateFileHeader (line 132) | private void CreateFileHeader(int rowsindexed)
method ReadFileHeader (line 161) | private bool ReadFileHeader()
method GetNewPageNumber (line 182) | public int GetNewPageNumber()
method SeekPage (line 187) | private void SeekPage(int pnum)
method CreateBlankPages (line 197) | private void CreateBlankPages(int pnum)
method FreeMemory (line 208) | public void FreeMemory()
method Shutdown (line 214) | public void Shutdown()
method GetPageList (line 237) | public void GetPageList(List<int> PageListDiskPages, SafeSortedList<T,...
method LoadPageListData (line 252) | private int LoadPageListData(int page, SafeSortedList<T, PageInfo> Pag...
method SavePage (line 306) | internal void SavePage(Page<T> page)
method LoadPageFromPageNumber (line 371) | public Page<T> LoadPageFromPageNumber(int number)
method SavePageList (line 423) | internal void SavePageList(SafeSortedList<T, PageInfo> _pages, List<in...
method CreatePageListData (line 471) | private void CreatePageListData(SafeSortedList<T, PageInfo> _pages, in...
method SaveLastRecordNumber (line 502) | internal void SaveLastRecordNumber(int recnum)
method BitmapFlush (line 508) | internal void BitmapFlush()
FILE: RaptorDB/Indexes/Indexes.cs
class TypeIndexes (line 8) | internal class TypeIndexes<T> : MGIndex<T>, IIndex where T : IComparable<T>
method TypeIndexes (line 10) | public TypeIndexes(string path, string filename, byte keysize)
method Set (line 16) | public void Set(object key, int recnum)
method Query (line 23) | public MGRB Query(RDBExpression ex, object from, int maxsize)
method Converter (line 34) | private T Converter(object from)
method FreeMemory (line 45) | void IIndex.FreeMemory()
method Shutdown (line 51) | void IIndex.Shutdown()
method GetKeys (line 56) | object[] IIndex.GetKeys()
method Query (line 61) | public MGRB Query(object fromkey, object tokey, int maxsize)
class BoolIndex (line 81) | internal class BoolIndex : IIndex
method BoolIndex (line 83) | public BoolIndex(string path, string filename, string extension)
method GetBits (line 100) | public MGRB GetBits()
method Set (line 105) | public void Set(object key, int recnum)
method Query (line 112) | public MGRB Query(RDBExpression ex, object from, int maxsize)
method FreeMemory (line 124) | public void FreeMemory()
method Shutdown (line 133) | public void Shutdown()
method SaveIndex (line 139) | public void SaveIndex()
method InPlaceOR (line 144) | public void InPlaceOR(MGRB left)
method WriteFile (line 150) | private void WriteFile()
method ReadFile (line 161) | private void ReadFile()
method Query (line 169) | public MGRB Query(object fromkey, object tokey, int maxsize)
method GetKeys (line 174) | public object[] GetKeys()
class FullTextIndex (line 182) | internal class FullTextIndex : Hoot, IIndex
method FullTextIndex (line 184) | public FullTextIndex(string IndexPath, string FileName, bool docmode, ...
method Set (line 196) | public void Set(object key, int recnum)
method Query (line 203) | public MGRB Query(RDBExpression ex, object from, int maxsize)
method SaveIndex (line 208) | public void SaveIndex()
method Query (line 215) | public MGRB Query(object fromkey, object tokey, int maxsize)
method GetKeys (line 220) | public object[] GetKeys()
method FreeMemory (line 227) | void IIndex.FreeMemory()
method Shutdown (line 234) | void IIndex.Shutdown()
class EnumIndex (line 246) | internal class EnumIndex<T> : MGIndex<string>, IIndex //where T : ICompa...
method EnumIndex (line 248) | public EnumIndex(string path, string filename)
method Set (line 254) | public void Set(object key, int recnum)
method Query (line 261) | public MGRB Query(RDBExpression ex, object from, int maxsize)
method Converter (line 272) | private T Converter(object from)
method FreeMemory (line 283) | void IIndex.FreeMemory()
method Shutdown (line 289) | void IIndex.Shutdown()
method Query (line 295) | public MGRB Query(object fromkey, object tokey, int maxsize)
method GetKeys (line 312) | object[] IIndex.GetKeys()
class NoIndex (line 320) | internal class NoIndex : IIndex
method Set (line 322) | public void Set(object key, int recnum)
method Query (line 327) | public MGRB Query(RDBExpression ex, object from, int maxsize)
method FreeMemory (line 333) | public void FreeMemory()
method Shutdown (line 338) | public void Shutdown()
method SaveIndex (line 343) | public void SaveIndex()
method GetKeys (line 348) | public object[] GetKeys()
method Query (line 353) | public MGRB Query(object fromkey, object tokey, int maxsize)
FILE: RaptorDB/Indexes/MGIndex.cs
type PageInfo (line 10) | internal struct PageInfo // FEATURE : change back to class for count ac...
method PageInfo (line 12) | public PageInfo(int pagenum, int uniquecount, int duplicatecount)
type KeyInfo (line 21) | internal struct KeyInfo
method KeyInfo (line 23) | public KeyInfo(int recnum)
method KeyInfo (line 28) | public KeyInfo(int recnum, int bitmaprec)
class Page (line 37) | internal class Page<T>
method Page (line 39) | public Page() // kludge so the compiler doesn't complain
class MGIndex (line 57) | internal class MGIndex<T> where T : IComparable<T>
method MGIndex (line 70) | public MGIndex(string path, string filename, byte keysize, bool allowd...
method GetLastIndexedRecordNumber (line 95) | public int GetLastIndexedRecordNumber()
method Query (line 100) | public MGRB Query(T from, T to, int maxsize)
method Query (line 169) | public MGRB Query(RDBExpression exp, T from, int maxsize)
method Set (line 190) | public void Set(T key, int val)
method Get (line 228) | public bool Get(T key, out int val)
method SaveIndex (line 240) | public void SaveIndex()
method Shutdown (line 260) | public void Shutdown()
method FreeMemory (line 269) | public void FreeMemory()
method GetDuplicates (line 288) | public IEnumerable<int> GetDuplicates(T key)
method SaveLastRecordNumber (line 302) | public void SaveLastRecordNumber(int recnum)
method RemoveKey (line 307) | public bool RemoveKey(T key)
method doMoreOp (line 323) | private MGRB doMoreOp(RDBExpression exp, T key)
method doLessOp (line 357) | private MGRB doLessOp(RDBExpression exp, T key)
method doEqualOp (line 391) | private MGRB doEqualOp(RDBExpression exp, T key, int maxsize)
method doPageOperation (line 414) | private void doPageOperation(ref MGRB res, int pageidx)
method SplitPage (line 427) | private void SplitPage(Page<T> page)
method LoadPage (line 461) | private Page<T> LoadPage(T key, out PageInfo pageinfo)
method LoadPage (line 483) | private Page<T> LoadPage(int pagenum)
method SaveDuplicate (line 495) | private void SaveDuplicate(T key, ref KeyInfo ki)
method FindPageOrLowerPosition (line 503) | private int FindPageOrLowerPosition(T key, ref bool found)
method GetKeys (line 537) | internal object[] GetKeys()
method Count (line 549) | internal int Count()
FILE: RaptorDB/Indexes/tokenizer.cs
class tokenizer (line 5) | class tokenizer : ITokenizer
method GenerateWordFreq (line 7) | public Dictionary<string, int> GenerateWordFreq(string text)
method langtype (line 36) | private static int langtype(char c)
method ParseString (line 54) | private static void ParseString(Dictionary<string, int> dic, char[] ch...
method AddDictionary (line 95) | private static void AddDictionary(Dictionary<string, int> dic, string ...
method addword (line 112) | private static void addword(Dictionary<string, int> dic, string word)
FILE: RaptorDB/Properties/Resources.Designer.cs
class Resources (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Resources (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: RaptorDB/REST/aWebServer.cs
class aWebServer (line 12) | public abstract class aWebServer
method aWebServer (line 14) | public aWebServer(int HttpPort, bool localonly, AuthenticationSchemes ...
method InitializeCommandHandler (line 25) | public abstract void InitializeCommandHandler(Dictionary<string, Handl...
method ListenerCallback (line 41) | private void ListenerCallback(IAsyncResult ar)
method Stop (line 116) | internal void Stop()
method OutPutContentType (line 121) | internal static bool OutPutContentType(HttpListenerContext ctx, string...
method WriteResponse (line 165) | internal void WriteResponse(HttpListenerContext ctx, int code, string ...
method WriteResponse (line 170) | internal void WriteResponse(HttpListenerContext ctx, int code, string ...
method WriteResponse (line 175) | internal void WriteResponse(HttpListenerContext ctx, int code, byte[] ...
method Start (line 198) | private void Start()
method ReadFromStream (line 233) | private byte[] ReadFromStream(string name)
method ReadResources (line 242) | private void ReadResources()
FILE: RaptorDB/REST/rdbRest.cs
class RDBRoute (line 14) | public class RDBRoute
method ToString (line 20) | public override string ToString()
type IRouteAPI (line 33) | public interface IRouteAPI
method AddRoute (line 35) | void AddRoute(RDBRoute route);
method RegisterView (line 36) | void RegisterView<T>(View<T> view);
type IRDBRouting (line 39) | public interface IRDBRouting
method Initialize (line 41) | void Initialize(IRouteAPI api);
class RDBJsonContainer (line 44) | public class RDBJsonContainer
class rdbRest (line 54) | class rdbRest : aWebServer, IRouteAPI
method rdbRest (line 56) | public rdbRest(int HttpPort, RaptorDB rdb, string routingpath, bool lo...
method Stop (line 73) | public new void Stop()
method AddRoute (line 80) | public void AddRoute(RDBRoute route)
method RegisterView (line 86) | public void RegisterView<T>(View<T> view)
method InitializeCommandHandler (line 93) | public override void InitializeCommandHandler(Dictionary<string, Handl...
method GetViewInfo (line 359) | private string GetViewInfo(string name)
method GetInfo (line 382) | private object GetInfo()
method GetMemoryUsage (line 402) | private string GetMemoryUsage() // KLUDGE but works
method WriteCsv (line 424) | private string WriteCsv(List<object> data)//, Stream stream)
method OutputJsonData (line 560) | private void OutputJsonData(HttpListenerContext ctx, List<object> o)
method DoQuery (line 575) | private Result<object> DoQuery(IRaptorDB rdb, HttpListenerContext ctx,...
method ProcessGET (line 641) | private void ProcessGET(IRaptorDB rdb, HttpListenerContext ctx, string...
FILE: RaptorDB/RaptorDB.cs
class RaptorDB (line 24) | public class RaptorDB : IRaptorDB
method RaptorDB (line 26) | private RaptorDB(string FolderPath, ITokenizer tokenizer)
method Open (line 55) | public static RaptorDB Open(string FolderPath)
method Open (line 60) | public static RaptorDB Open(string FolderPath, ITokenizer tokenizer)
method SaveBytes (line 102) | public bool SaveBytes(Guid docID, byte[] bytes)
method Delete (line 113) | public bool Delete(Guid docid)
method DeleteBytes (line 125) | public bool DeleteBytes(Guid bytesid)
method Save (line 137) | public bool Save<T>(Guid docid, T data)
method Uptime (line 195) | internal TimeSpan Uptime()
method FileCount (line 200) | internal object FileCount()
method Query (line 211) | public Result<object> Query(string viewname)
method Query (line 222) | public Result<object> Query(string viewname, string filter)
method Fetch (line 235) | public object Fetch(Guid docID)
method FetchBytes (line 247) | public byte[] FetchBytes(Guid fileID)
method RegisterView (line 261) | public void RegisterView<T>(View<T> view)
method Shutdown (line 269) | public void Shutdown()
method Backup (line 324) | public bool Backup()
method ProcessReplicationInbox (line 362) | private void ProcessReplicationInbox(string inboxfolder)
method DoRepProcessing (line 411) | private bool DoRepProcessing(string filename, int start)
method DeleteReplicate (line 468) | private void DeleteReplicate(Guid docid)
method Restore (line 478) | public void Restore()
method DoRestoreProcessinng (line 528) | private bool DoRestoreProcessinng(string filename, int start)
method SaveReplicationObject (line 569) | private bool SaveReplicationObject<T>(Guid docid, T data)
method AddUser (line 602) | public bool AddUser(string username, string oldpassword, string newpas...
method ServerSide (line 613) | public object[] ServerSide(ServerSideFunc func, string filter)
method ServerSide (line 625) | public object[] ServerSide<TRowSchema>(ServerSideFunc func, Expression...
method FullTextSearch (line 637) | public int[] FullTextSearch(string filter)
method Query (line 652) | public Result<TRowSchema> Query<TRowSchema>(Expression<Predicate<TRowS...
method Query (line 665) | public Result<TRowSchema> Query<TRowSchema>(Expression<Predicate<TRowS...
method Query (line 679) | public Result<TRowSchema> Query<TRowSchema>(Expression<Predicate<TRowS...
method Query (line 690) | public Result<TRowSchema> Query<TRowSchema>(string filter)
method Query (line 703) | public Result<TRowSchema> Query<TRowSchema>(string filter, int start, ...
method Count (line 714) | public int Count<TRowSchema>(Expression<Predicate<TRowSchema>> filter)
method Query (line 726) | public Result<object> Query(string viewname, int start, int count)
method Query (line 739) | public Result<object> Query(string viewname, string filter, int start,...
method Count (line 749) | public int Count(string viewname)
method Count (line 760) | public int Count(string viewname, string filter)
method FetchHistory (line 770) | public int[] FetchHistory(Guid docid)
method FetchBytesHistory (line 780) | public int[] FetchBytesHistory(Guid fileid)
method FetchVersion (line 790) | public object FetchVersion(int versionNumber)
method FetchBytesVersion (line 801) | public byte[] FetchBytesVersion(int versionNumber)
method GetViews (line 810) | public List<ViewBase> GetViews()
method GetSchema (line 820) | public ViewRowDefinition GetSchema(string view)
method Query (line 834) | public Result<object> Query(string viewname, string filter, int start,...
method Query (line 848) | public Result<TRowSchema> Query<TRowSchema>(string filter, int start, ...
method FetchHistoryInfo (line 858) | public HistoryInfo[] FetchHistoryInfo(Guid docid)
method FetchBytesHistoryInfo (line 879) | public HistoryInfo[] FetchBytesHistoryInfo(Guid docid)
method ViewDelete (line 901) | public int ViewDelete<TRowSchema>(Expression<Predicate<TRowSchema>> fi...
method ViewDelete (line 927) | public int ViewDelete(string viewname, string filter)
method ViewInsert (line 952) | public bool ViewInsert<TRowSchema>(Guid id, TRowSchema row)
method ViewInsert (line 980) | public bool ViewInsert(string viewname, Guid id, object row)
method DocumentCount (line 1001) | public long DocumentCount()
method GetKVHF (line 1006) | public IKeyStoreHF GetKVHF()
method ServerSide (line 1011) | public object[] ServerSide(ServerSideFuncWithArgs func, string filter,...
method ServerSide (line 1016) | public object[] ServerSide<TRowSchema>(ServerSideFuncWithArgs func, Ex...
method GetViewName (line 1026) | internal string GetViewName(Type type)
method SaveToView (line 1031) | private bool SaveToView<T>(Guid docid, T data, List<string> list)
method SaveInOtherViewsTransaction (line 1043) | private bool SaveInOtherViewsTransaction<T>(Guid docid, T data)
method SaveToConsistentViewsTransaction (line 1049) | private bool SaveToConsistentViewsTransaction<T>(Guid docid, T data)
method SaveInPrimaryViewTransaction (line 1055) | private bool SaveInPrimaryViewTransaction<T>(string viewname, Guid doc...
method PumpDataForBackup (line 1060) | private static void PumpDataForBackup(Stream input, Stream output)
method CompressForBackup (line 1068) | private static void CompressForBackup(Stream source, Stream destination)
method DecompressForRestore (line 1074) | private static void DecompressForRestore(Stream source, Stream destina...
method SaveToConsistentViews (line 1080) | private void SaveToConsistentViews<T>(Guid docid, T data)
method CreateObject (line 1091) | private object CreateObject(byte[] b)
method SaveInOtherViews (line 1099) | private void SaveInOtherViews<T>(Guid docid, T data)
method SaveInPrimaryView (line 1107) | private void SaveInPrimaryView<T>(string viewname, Guid docid, T data)
method Initialize (line 1112) | private void Initialize()
method RebuildDataFiles (line 1235) | private void RebuildDataFiles()
method _processinboxTimer_Elapsed (line 1298) | void _processinboxTimer_Elapsed(object sender, System.Timers.ElapsedEv...
method CompileAndRegisterScriptViews (line 1314) | private void CompileAndRegisterScriptViews(string viewfolder)
method CompileScript (line 1349) | private Assembly CompileScript(string file)
method _freeMemTimer_Elapsed (line 1409) | void _freeMemTimer_Elapsed(object sender, System.Timers.ElapsedEventAr...
method UpgradeStorageFile (line 1414) | private void UpgradeStorageFile(string filename, int ver)
method _saveTimer_Elapsed (line 1422) | private void _saveTimer_Elapsed(object sender, System.Timers.ElapsedEv...
method _fulltextTimer_Elapsed (line 1474) | private void _fulltextTimer_Elapsed(object sender, System.Timers.Elaps...
method GetSave (line 1516) | private MethodInfo GetSave(Type type)
method GetSaveReplicate (line 1527) | private MethodInfo GetSaveReplicate(Type type)
method CreateTemplateConfigFiles (line 1538) | private void CreateTemplateConfigFiles()
method GetDataFolderSize (line 1557) | internal long GetDataFolderSize()
method GetDirectorySize (line 1563) | internal long GetDirectorySize(string path)
method GetAssemblyForView (line 1580) | internal object GetAssemblyForView(string viewname, out string typename)
method Fetch (line 1585) | public T Fetch<T>(Guid docID) where T : class
method FreeMemory (line 1590) | public void FreeMemory()
method SaveToDocsOnViewInsert (line 1606) | public void SaveToDocsOnViewInsert(bool yes)
FILE: RaptorDB/RaptorDBServer.cs
class instance_handler (line 13) | public class instance_handler
class RaptorDBServer (line 27) | public class RaptorDBServer
method RaptorDBServer (line 29) | public RaptorDBServer(int port, string DataPath)
method _unusedinstancetimer_Elapsed (line 78) | private void _unusedinstancetimer_Elapsed(object sender, System.Timers...
method _concleanuptimer_Elapsed (line 110) | void _concleanuptimer_Elapsed(object sender, System.Timers.ElapsedEven...
method CurrentDomain_AssemblyResolve (line 139) | private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveE...
method GetSave (line 153) | private MethodInfo GetSave(Type type)
method Shutdown (line 164) | public void Shutdown()
method WriteUsers (line 178) | private void WriteUsers()
method processpayload (line 192) | private object processpayload(object data)
method GetInstance (line 223) | private RaptorDB GetInstance(string name)
method InitializeCommandsDictionary (line 255) | private void InitializeCommandsDictionary()
method GetServerSideFuncWithArgsCache (line 562) | private ServerSideFuncWithArgs GetServerSideFuncWithArgsCache(string t...
method GetServerSideFuncCache (line 576) | private ServerSideFunc GetServerSideFuncCache(string type, string method)
method GenHash (line 590) | private uint GenHash(string user, string pwd)
method AddUser (line 595) | private bool AddUser(string user, string oldpwd, string newpwd)
method Authenticate (line 611) | private bool Authenticate(Packet p)
method Initialize (line 623) | private void Initialize()
FILE: RaptorDB/Replication/Configuration.cs
class WhereItem (line 5) | public class WhereItem
class WhatItem (line 13) | public class WhatItem
method WhatItem (line 15) | public WhatItem()
class ServerConfiguration (line 28) | public class ServerConfiguration
method ServerConfiguration (line 30) | public ServerConfiguration()
type REPMODE (line 42) | public enum REPMODE
class ClientConfiguration (line 48) | public class ClientConfiguration
method ClientConfiguration (line 50) | public ClientConfiguration()
FILE: RaptorDB/Replication/Packets.cs
class ReplicationPacket (line 3) | public class ReplicationPacket
FILE: RaptorDB/Replication/ReplicationClient.cs
class ClientRepConfig (line 9) | public class ClientRepConfig
class ClientWhatWhenConfig (line 21) | public class ClientWhatWhenConfig
class ReplicationClient (line 30) | internal class ReplicationClient
method ReplicationClient (line 32) | public ReplicationClient(string dataFolder, string config, IDocStorage...
method Initialize (line 42) | private void Initialize()
method Shutdown (line 73) | public void Shutdown()
method SaveConfig (line 81) | private void SaveConfig()
method Replicate (line 93) | private void Replicate()
method GetPackageFormHQ (line 120) | private void GetPackageFormHQ()
method SendPackageToHQ (line 151) | private void SendPackageToHQ()
method createpacket (line 168) | private ReplicationPacket createpacket()
method ConnectToHQ (line 176) | private bool ConnectToHQ()
method CreatePackageForSend (line 209) | private string CreatePackageForSend()
method MatchType (line 254) | private bool MatchType(string typename)
method CompressForBackup (line 268) | private static void CompressForBackup(Stream source, Stream destination)
method PumpDataForBackup (line 274) | private static void PumpDataForBackup(Stream input, Stream output)
FILE: RaptorDB/Replication/ReplicationServer.cs
class ReplicationServer (line 9) | internal class ReplicationServer
method ReplicationServer (line 11) | public ReplicationServer(string datapath, string config, IDocStorage<G...
method Initialize (line 29) | private void Initialize(string config)
method Shutdown (line 60) | public void Shutdown()
method WriteBranchCounters (line 67) | private void WriteBranchCounters()
method processpayload (line 77) | private object processpayload(object data)
method GetBranchConfig (line 119) | private ClientWhatWhenConfig GetBranchConfig(string branchname)
method PackageForHQ (line 137) | private bool PackageForHQ(ReplicationPacket p)
method GetPackageForBranch (line 152) | private ReplicationPacket GetPackageForBranch(ReplicationPacket packet)
method Authenticate (line 170) | private bool Authenticate(ReplicationPacket p)
method CreatePackageForSend (line 184) | private string CreatePackageForSend(ReplicationPacket packet, out int ...
method MatchType (line 230) | private bool MatchType(string typename, WhatItem what)
method CompressForBackup (line 244) | private static void CompressForBackup(Stream source, Stream destination)
method PumpDataForBackup (line 250) | private static void PumpDataForBackup(Stream input, Stream output)
FILE: RaptorDB/Storage/KeyStore.cs
class KeyStoreString (line 10) | internal class KeyStoreString : IDisposable
method KeyStoreString (line 12) | public KeyStoreString(string filename, bool caseSensitve)
method Set (line 22) | public void Set(string key, string val)
method Set (line 27) | public void Set(string key, byte[] val)
method Get (line 40) | public bool Get(string key, out string val)
method Get (line 52) | public bool Get(string key, out byte[] val)
method Count (line 87) | public int Count()
method RecordCount (line 92) | public int RecordCount()
method SaveIndex (line 97) | public void SaveIndex()
method Shutdown (line 102) | public void Shutdown()
method Dispose (line 107) | public void Dispose()
method UnpackData (line 112) | private bool UnpackData(byte[] buffer, out byte[] val, out byte[] key)
method ReadData (line 123) | public string ReadData(int recnumber)
method FreeMemory (line 135) | internal void FreeMemory()
class KeyStore (line 293) | internal class KeyStore<T> : IDisposable, IDocStorage<T> where T : IComp...
method KeyStore (line 295) | public KeyStore(string Filename, byte MaxKeySize, bool AllowDuplicateK...
method KeyStore (line 300) | public KeyStore(string Filename, bool AllowDuplicateKeys)
method Open (line 319) | public static KeyStore<T> Open(string Filename, bool AllowDuplicateKeys)
method Open (line 324) | public static KeyStore<T> Open(string Filename, byte MaxKeySize, bool ...
method SaveIndex (line 330) | public void SaveIndex()
method GetDuplicates (line 343) | public IEnumerable<int> GetDuplicates(T key)
method FetchRecordBytes (line 349) | public byte[] FetchRecordBytes(int record)
method Count (line 354) | public long Count()
method Get (line 360) | public bool Get(T key, out string val)
method GetObject (line 375) | public bool GetObject(T key, out object val)
method GetBytes (line 387) | public bool GetBytes(T key, out byte[] val)
method SetString (line 400) | public int SetString(T key, string data)
method SetObject (line 405) | public int SetObject(T key, object doc)
method SetBytes (line 416) | public int SetBytes(T key, byte[] data)
method Shutdown (line 428) | public void Shutdown()
method Dispose (line 454) | public void Dispose()
method SaveLastRecord (line 460) | private void SaveLastRecord()
method Initialize (line 466) | private void Initialize(string filename, byte maxkeysize, bool AllowDu...
method CheckIndexState (line 502) | private void CheckIndexState()
method _savetimer_Elapsed (line 530) | void _savetimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
method RecordCount (line 537) | public int RecordCount()
method GetHistory (line 542) | public int[] GetHistory(T key)
method FetchRecordBytes (line 552) | internal byte[] FetchRecordBytes(int record, out bool isdeleted)
method Delete (line 560) | internal bool Delete(T id)
method DeleteReplicated (line 568) | internal bool DeleteReplicated(T id)
method CopyTo (line 576) | internal int CopyTo(StorageFile<T> storagefile, long startrecord)
method GetBytes (line 581) | public byte[] GetBytes(int rowid, out StorageItem<T> meta)
method FreeMemory (line 586) | internal void FreeMemory()
method GetObject (line 591) | public object GetObject(int rowid, out StorageItem<T> meta)
method GetMeta (line 596) | public StorageItem<T> GetMeta(int rowid)
method SetReplicationObject (line 601) | internal int SetReplicationObject(T key, object doc)
FILE: RaptorDB/Storage/KeyStoreHF.cs
class KeyStoreHF (line 10) | public class KeyStoreHF : IKeyStoreHF
class AllocationBlock (line 12) | internal class AllocationBlock
method KeyStoreHF (line 44) | public KeyStoreHF(string folder)
method CountHF (line 74) | public int CountHF()
method GetObjectHF (line 82) | public object GetObjectHF(string key)
method SetObjectHF (line 102) | public bool SetObjectHF(string key, object obj)
method DeleteKeyHF (line 132) | public bool DeleteKeyHF(string key)
method CompactStorageHF (line 167) | public void CompactStorageHF()
method GetKeysHF (line 214) | public string[] GetKeysHF()
method ContainsHF (line 220) | public bool ContainsHF(string key)
method Shutdown (line 229) | public void Shutdown()
method FreeMemory (line 239) | internal void FreeMemory()
method readblockdata (line 246) | private byte[] readblockdata(AllocationBlock ab)
method WriteDirtyFile (line 267) | private void WriteDirtyFile()
method SaveNew (line 277) | private void SaveNew(string key, byte[] keybytes, object obj)
method internalSave (line 300) | private int internalSave(byte[] keybytes, byte[] data, AllocationBlock...
method CreateAllocHeader (line 338) | private byte[] CreateAllocHeader(AllocationBlock ab, byte[] keybytes)
method FillAllocationBlock (line 357) | private AllocationBlock FillAllocationBlock(int blocknumber)
method ParseBlockHeader (line 383) | private int ParseBlockHeader(AllocationBlock ab, byte[] b, int blocknu...
method RebuildDataFiles (line 420) | private void RebuildDataFiles()
method Increment (line 562) | public int Increment(string key, int amount)
method Decrement (line 610) | public int Decrement(string key, int amount)
method Increment (line 615) | public decimal Increment(string key, decimal amount)
method Decrement (line 659) | public decimal Decrement(string key, decimal amount)
FILE: RaptorDB/Storage/StorageFile.cs
class StorageData (line 11) | internal class StorageData<T>
class StorageItem (line 17) | public class StorageItem<T>
type IDocStorage (line 28) | public interface IDocStorage<T>
method RecordCount (line 30) | int RecordCount();
method GetBytes (line 32) | byte[] GetBytes(int rowid, out StorageItem<T> meta);
method GetObject (line 33) | object GetObject(int rowid, out StorageItem<T> meta);
method GetMeta (line 34) | StorageItem<T> GetMeta(int rowid);
method GetObject (line 36) | bool GetObject(T key, out object doc);
type SF_FORMAT (line 39) | public enum SF_FORMAT
type SplitFile (line 45) | internal struct SplitFile
class StorageFile (line 52) | public class StorageFile<T>
method StorageFile (line 96) | public StorageFile(string filename)
method StorageFile (line 110) | public StorageFile(string filename, SF_FORMAT format, bool StorageOnly...
method StorageFile (line 119) | private StorageFile(string filename, bool StorageOnlyMode)
method Initialize (line 124) | private void Initialize(string filename, bool StorageOnlyMode)
method LoadSplitFiles (line 174) | private void LoadSplitFiles(string filename)
method GetStorageFileHeaderVersion (line 196) | public static int GetStorageFileHeaderVersion(string filename)
method Count (line 214) | public int Count()
method WriteRawData (line 219) | public long WriteRawData(byte[] b)
method Delete (line 224) | public long Delete(T key)
method DeleteReplicated (line 233) | public long DeleteReplicated(T key)
method WriteObject (line 243) | public long WriteObject(T key, object obj)
method WriteReplicationObject (line 261) | public long WriteReplicationObject(T key, object obj)
method WriteData (line 280) | public long WriteData(T key, byte[] data)
method ReadBytes (line 294) | public byte[] ReadBytes(long recnum)
method ReadObject (line 300) | public object ReadObject(long recnum)
method ReadObject (line 306) | public object ReadObject(long recnum, out StorageItem<T> meta)
method ViewReadRawBytes (line 323) | public byte[] ViewReadRawBytes(long recnum)
method Shutdown (line 349) | public void Shutdown()
method ReadForward (line 365) | public static StorageFile<Guid> ReadForward(string filename)
method ReadMeta (line 372) | public StorageItem<T> ReadMeta(long rowid)
method internalWriteData (line 388) | private long internalWriteData(StorageItem<T> meta, byte[] data, bool ...
method CreateNewStorageFile (line 444) | private void CreateNewStorageFile()
method ReadBytes (line 472) | internal byte[] ReadBytes(long recnum, out StorageItem<T> meta)
method ComputeOffset (line 490) | private long ComputeOffset(long recnum)
method internalReadBytes (line 508) | private byte[] internalReadBytes(FileStream fs, out StorageItem<T> meta)
method ReadMetaData (line 530) | private StorageItem<T> ReadMetaData(FileStream fs, out int metasize)
method FlushClose (line 559) | private void FlushClose(FileStream st)
method GetKey (line 568) | internal T GetKey(long recnum, out bool deleted)
method CopyTo (line 583) | internal int CopyTo(StorageFile<T> storageFile, long startrecord)
method Pump (line 624) | private static void Pump(Stream input, Stream output)
method ReadOnlyEnumerate (line 632) | internal IEnumerable<StorageData<T>> ReadOnlyEnumerate()
method GetReadFileStreamWithSeek (line 676) | private FileStream GetReadFileStreamWithSeek(long offset)
method binarysearch (line 699) | private int binarysearch(long offset)
FILE: RaptorDB/Storage/StorageFileHF.cs
class StorageFileHF (line 10) | internal class StorageFileHF
method StorageFileHF (line 34) | public StorageFileHF(string filename, ushort blocksize)
method Shutdown (line 43) | public void Shutdown()
method GetBlockSize (line 51) | public ushort GetBlockSize()
method FreeBlocks (line 56) | internal void FreeBlocks(List<int> list)
method ReadBlock (line 61) | internal byte[] ReadBlock(int blocknumber)
method ReadBlockBytes (line 70) | internal byte[] ReadBlockBytes(int blocknumber, int bytes)
method GetFreeBlockNumber (line 79) | internal int GetFreeBlockNumber()
method InitializeFreeList (line 92) | private void InitializeFreeList()
method SeekBlock (line 147) | internal void SeekBlock(int blocknumber)
method WriteBlockBytes (line 154) | internal void WriteBlockBytes(byte[] data, int start, int len)
method WriteFreeListBMPFile (line 161) | private void WriteFreeListBMPFile()
method Initialize (line 189) | private void Initialize(string filename, ushort blocksize)
method ReadFileHeader (line 219) | private int ReadFileHeader()
method CreateFileHeader (line 232) | private void CreateFileHeader(int blocksize)
method FlushClose (line 242) | private void FlushClose(FileStream st)
method NumberofBlocks (line 252) | internal int NumberofBlocks()
method FreeBlock (line 257) | internal void FreeBlock(int i)
FILE: RaptorDB/Storage/StringHF.cs
class StringHF (line 10) | public class StringHF //: IKeyStoreHF
class AllocationBlock (line 12) | internal class AllocationBlock
method StringHF (line 46) | public StringHF(string folder, string filename)
method Shutdown (line 57) | public void Shutdown()
method FreeMemory (line 67) | internal void FreeMemory()
method readblockdata (line 74) | private byte[] readblockdata(AllocationBlock ab)
method internalSave (line 94) | private int internalSave(byte[] keybytes, byte[] data, AllocationBlock...
method CreateAllocHeader (line 136) | private byte[] CreateAllocHeader(AllocationBlock ab, byte[] keybytes)
method FillAllocationBlock (line 155) | private AllocationBlock FillAllocationBlock(int blocknumber)
method ParseBlockHeader (line 181) | private int ParseBlockHeader(AllocationBlock ab, byte[] b, int blocknu...
method FreeBlocks (line 220) | internal void FreeBlocks(List<int> list)
method SaveData (line 228) | internal int SaveData(string key, byte[] data, out List<int> blocks)
method GetData (line 247) | internal byte[] GetData(int blocknumber, out List<int> usedblocks)
FILE: RaptorDB/Views/Dynamic.cs
class DynamicClass (line 15) | internal abstract class DynamicClass
method ToString (line 17) | public override string ToString()
class DynamicProperty (line 34) | internal class DynamicProperty
method DynamicProperty (line 39) | public DynamicProperty(string name, Type type)
class DynamicExpression (line 58) | internal static class DynamicExpression
method Parse (line 60) | public static Expression Parse(Type resultType, string expression, par...
method ParseLambda (line 66) | public static LambdaExpression ParseLambda(Type itType, Type resultTyp...
method ParseLambda (line 71) | public static LambdaExpression ParseLambda(ParameterExpression[] param...
method CreateClass (line 82) | public static Type CreateClass(params DynamicProperty[] properties)
method CreateClass (line 87) | public static Type CreateClass(IEnumerable<DynamicProperty> properties)
class Signature (line 99) | internal class Signature : IEquatable<Signature>
method Signature (line 104) | public Signature(IEnumerable<DynamicProperty> properties)
method GetHashCode (line 114) | public override int GetHashCode()
method Equals (line 119) | public override bool Equals(object obj)
method Equals (line 124) | public bool Equals(Signature other)
class ClassFactory (line 136) | internal class ClassFactory
method ClassFactory (line 140) | static ClassFactory() { }
method ClassFactory (line 147) | private ClassFactory()
method GetDynamicClass (line 172) | public Type GetDynamicClass(IEnumerable<DynamicProperty> properties)
method CreateDynamicClass (line 192) | Type CreateDynamicClass(DynamicProperty[] properties)
method GenerateProperties (line 229) | FieldInfo[] GenerateProperties(TypeBuilder tb, DynamicProperty[] prope...
method GenerateEquals (line 259) | void GenerateEquals(TypeBuilder tb, FieldInfo[] fields)
method GenerateGetHashCode (line 296) | void GenerateGetHashCode(TypeBuilder tb, FieldInfo[] fields)
class ParseException (line 318) | internal sealed class ParseException : Exception
method ParseException (line 322) | public ParseException(string message, int position)
method ToString (line 333) | public override string ToString()
class ExpressionParser (line 340) | internal class ExpressionParser
type Token (line 343) | struct Token
type TokenId (line 350) | enum TokenId
type ILogicalSignatures (line 386) | interface ILogicalSignatures
method F (line 388) | void F(bool x, bool y);
method F (line 389) | void F(bool? x, bool? y);
type IArithmeticSignatures (line 392) | interface IArithmeticSignatures
method F (line 394) | void F(int x, int y);
method F (line 395) | void F(uint x, uint y);
method F (line 396) | void F(long x, long y);
method F (line 397) | void F(ulong x, ulong y);
method F (line 398) | void F(float x, float y);
method F (line 399) | void F(double x, double y);
method F (line 400) | void F(decimal x, decimal y);
method F (line 401) | void F(int? x, int? y);
method F (line 402) | void F(uint? x, uint? y);
method F (line 403) | void F(long? x, long? y);
method F (line 404) | void F(ulong? x, ulong? y);
method F (line 405) | void F(float? x, float? y);
method F (line 406) | void F(double? x, double? y);
method F (line 407) | void F(decimal? x, decimal? y);
type IRelationalSignatures (line 410) | interface IRelationalSignatures : IArithmeticSignatures
method F (line 412) | void F(string x, string y);
method F (line 413) | void F(char x, char y);
method F (line 414) | void F(DateTime x, DateTime y);
method F (line 415) | void F(TimeSpan x, TimeSpan y);
method F (line 416) | void F(char? x, char? y);
method F (line 417) | void F(DateTime? x, DateTime? y);
method F (line 418) | void F(TimeSpan? x, TimeSpan? y);
type IEqualitySignatures (line 421) | interface IEqualitySignatures : IRelationalSignatures
method F (line 423) | void F(bool x, bool y);
method F (line 424) | void F(bool? x, bool? y);
type IAddSignatures (line 427) | interface IAddSignatures : IArithmeticSignatures
method F (line 429) | void F(DateTime x, TimeSpan y);
method F (line 430) | void F(TimeSpan x, TimeSpan y);
method F (line 431) | void F(DateTime? x, TimeSpan? y);
method F (line 432) | void F(TimeSpan? x, TimeSpan? y);
type ISubtractSignatures (line 435) | interface ISubtractSignatures : IAddSignatures
method F (line 437) | void F(DateTime x, DateTime y);
method F (line 438) | void F(DateTime? x, DateTime? y);
type INegationSignatures (line 441) | interface INegationSignatures
method F (line 443) | void F(int x);
method F (line 444) | void F(long x);
method F (line 445) | void F(float x);
method F (line 446) | void F(double x);
method F (line 447) | void F(decimal x);
method F (line 448) | void F(int? x);
method F (line 449) | void F(long? x);
method F (line 450) | void F(float? x);
method F (line 451) | void F(double? x);
method F (line 452) | void F(decimal? x);
type INotSignatures (line 455) | interface INotSignatures
method F (line 457) | void F(bool x);
method F (line 458) | void F(bool? x);
type IEnumerableSignatures (line 461) | interface IEnumerableSignatures
method Where (line 463) | void Where(bool predicate);
method Any (line 464) | void Any();
method Any (line 465) | void Any(bool predicate);
method All (line 466) | void All(bool predicate);
method Count (line 467) | void Count();
method Count (line 468) | void Count(bool predicate);
method Min (line 469) | void Min(object selector);
method Max (line 470) | void Max(object selector);
method Sum (line 471) | void Sum(int selector);
method Sum (line 472) | void Sum(int? selector);
method Sum (line 473) | void Sum(long selector);
method Sum (line 474) | void Sum(long? selector);
method Sum (line 475) | void Sum(float selector);
method Sum (line 476) | void Sum(float? selector);
method Sum (line 477) | void Sum(double selector);
method Sum (line 478) | void Sum(double? selector);
method Sum (line 479) | void Sum(decimal selector);
method Sum (line 480) | void Sum(decimal? selector);
method Average (line 481) | void Average(int selector);
method Average (line 482) | void Average(int? selector);
method Average (line 483) | void Average(long selector);
method Average (line 484) | void Average(long? selector);
method Average (line 485) | void Average(float selector);
method Average (line 486) | void Average(float? selector);
method Average (line 487) | void Average(double selector);
method Average (line 488) | void Average(double? selector);
method Average (line 489) | void Average(decimal selector);
method Average (line 490) | void Average(decimal? selector);
method ParseArgumentList (line 761) | Expression[] ParseArgumentList()
method ParseArguments (line 771) | Expression[] ParseArguments()
method ExpressionParser (line 855) | public ExpressionParser(ParameterExpression[] parameters, string expre...
method ProcessParameters (line 869) | void ProcessParameters(ParameterExpression[] parameters)
method ProcessValues (line 878) | void ProcessValues(object[] values)
method AddSymbol (line 894) | void AddSymbol(string name, object value)
method Parse (line 901) | public Expression Parse(Type resultType)
method ParseExpression (line 914) | Expression ParseExpression()
method ParseLogicalOr (line 931) | Expression ParseLogicalOr()
method ParseLogicalAnd (line 946) | Expression ParseLogicalAnd()
method ParseComparison (line 961) | Expression ParseComparison()
method ParseAdditive (line 1049) | Expression ParseAdditive()
method ParseUnary (line 1079) | Expression ParseUnary()
method ParsePrimary (line 1109) | Expression ParsePrimary()
method ParsePrimaryStart (line 1131) | Expression ParsePrimaryStart()
method ParseStringLiteral (line 1150) | Expression ParseStringLiteral()
method ParseIntegerLiteral (line 1174) | Expression ParseIntegerLiteral()
method ParseRealLiteral (line 1201) | Expression ParseRealLiteral()
method CreateLiteral (line 1222) | Expression CreateLiteral(object value, string text)
method ParseParenExpression (line 1229) | Expression ParseParenExpression()
method ParseIdentifier (line 1239) | Expression ParseIdentifier()
method ParseTypeAccess (line 1272) | Expression ParseTypeAccess(Type type)
method CallBetween (line 1305) | Expression CallBetween(Expression instance, Type checktype, Type datat...
method CallIn (line 1335) | Expression CallIn(Expression instance, Type checktype, Type datatype, ...
method ParseMemberAccess (line 1367) | Expression ParseMemberAccess(Type type, Expression instance)
method IsNullableType (line 1435) | static bool IsNullableType(Type type)
method GetNonNullableType (line 1440) | static Type GetNonNullableType(Type type)
method GetTypeName (line 1445) | static string GetTypeName(Type type)
method IsSignedIntegralType (line 1453) | static bool IsSignedIntegralType(Type type)
method IsUnsignedIntegralType (line 1458) | static bool IsUnsignedIntegralType(Type type)
method GetNumericTypeKind (line 1463) | static int GetNumericTypeKind(Type type)
method CheckAndPromoteOperand (line 1489) | void CheckAndPromoteOperand(Type signatures, string opName, ref Expres...
method CheckAndPromoteOperands (line 1499) | void CheckAndPromoteOperands(Type signatures, string opName, ref Expre...
method IncompatibleOperandsError (line 1509) | Exception IncompatibleOperandsError(string opName, Expression left, Ex...
method FindPropertyOrField (line 1515) | MemberInfo FindPropertyOrField(Type type, string memberName, bool stat...
method FindMethod (line 1528) | int FindMethod(Type type, string methodName, bool staticAccess, Expres...
method FindIndexer (line 1543) | int FindIndexer(Type type, Expression[] args, out MethodBase method)
method SelfAndBaseTypes (line 1562) | static IEnumerable<Type> SelfAndBaseTypes(Type type)
method SelfAndBaseClasses (line 1573) | static IEnumerable<Type> SelfAndBaseClasses(Type type)
method AddInterface (line 1582) | static void AddInterface(List<Type> types, Type type)
class MethodData (line 1591) | class MethodData
method FindBestMethod (line 1598) | int FindBestMethod(IEnumerable<MethodBase> methods, Expression[] args,...
method IsApplicable (line 1623) | bool IsApplicable(MethodData method, Expression[] args)
method PromoteExpression (line 1639) | Expression PromoteExpression(Expression expr, Type type, bool exact)
method ParseNumber (line 1685) | static object ParseNumber(string text, Type type)
method ParseEnum (line 1737) | static object ParseEnum(string name, Type type)
method IsCompatibleWith (line 1749) | static bool IsCompatibleWith(Type source, Type target)
method IsBetterThan (line 1873) | static bool IsBetterThan(Expression[] args, MethodData m1, MethodData m2)
method CompareConversions (line 1890) | static int CompareConversions(Type s, Type t1, Type t2)
method GenerateEqual (line 1904) | Expression GenerateEqual(Expression left, Expression right)
method GenerateNotEqual (line 1909) | Expression GenerateNotEqual(Expression left, Expression right)
method GenerateGreaterThan (line 1914) | Expression GenerateGreaterThan(Expression left, Expression right)
method GenerateGreaterThanEqual (line 1926) | Expression GenerateGreaterThanEqual(Expression left, Expression right)
method GenerateLessThan (line 1938) | Expression GenerateLessThan(Expression left, Expression right)
method GenerateLessThanEqual (line 1950) | Expression GenerateLessThanEqual(Expression left, Expression right)
method GetStaticMethod (line 1962) | MethodInfo GetStaticMethod(string methodName, Expression left, Express...
method GenerateStaticMethodCall (line 1967) | Expression GenerateStaticMethodCall(string methodName, Expression left...
method SetTextPos (line 1972) | void SetTextPos(int pos)
method NextChar (line 1978) | void NextChar()
method NextToken (line 1984) | void NextToken()
method TokenIdentifierIs (line 2186) | bool TokenIdentifierIs(string id)
method GetIdentifier (line 2191) | string GetIdentifier()
method ValidateDigit (line 2199) | void ValidateDigit()
method ValidateToken (line 2204) | void ValidateToken(TokenId t, string errorMessage)
method ValidateToken (line 2209) | void ValidateToken(TokenId t)
method ParseError (line 2214) | Exception ParseError(string format, params object[] args)
method ParseError (line 2219) | Exception ParseError(int pos, string format, params object[] args)
method CreateKeywords (line 2224) | static Dictionary<string, object> CreateKeywords()
class Res (line 2238) | static class Res
FILE: RaptorDB/Views/LINQQuery.cs
class QueryVisitor (line 13) | internal class QueryVisitor : ExpressionVisitor
method QueryVisitor (line 15) | public QueryVisitor(QueryExpression express, QueryFromTo fromto)
method VisitBinary (line 26) | protected override Expression VisitBinary(BinaryExpression b)
method VisitMethodCall (line 87) | protected override Expression VisitMethodCall(MethodCallExpression m)
method Visit (line 166) | public override Expression Visit(Expression node)
method GetValueForMember (line 195) | private object GetValueForMember(object m)
method VisitMember (line 216) | protected override Expression VisitMember(MemberExpression m)
method VisitConstant (line 260) | protected override Expression VisitConstant(ConstantExpression c)
FILE: RaptorDB/Views/TaskQueue.cs
class TaskQueue (line 8) | internal class TaskQueue
method TaskQueue (line 10) | public TaskQueue()
method _timer_Elapsed (line 25) | void _timer_Elapsed(object sender, ElapsedEventArgs e)
method AddTask (line 48) | public void AddTask(Action action)
method Shutdown (line 54) | public void Shutdown()
FILE: RaptorDB/Views/ViewHandler.cs
class ViewRowDefinition (line 16) | public class ViewRowDefinition
method ViewRowDefinition (line 18) | public ViewRowDefinition()
method Add (line 24) | public void Add(string name, Type type)
class tran_data (line 30) | internal class tran_data
class ViewHandler (line 36) | internal class ViewHandler
method ViewHandler (line 40) | public ViewHandler(string path, ViewManager manager)
method _saveTimer_Elapsed (line 75) | void _saveTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
method GetFireOnType (line 88) | public Type GetFireOnType()
method SetView (line 93) | internal void SetView<T>(View<T> view, IDocStorage<Guid> docs)
method FreeMemory (line 181) | internal void FreeMemory()
method Commit (line 191) | internal void Commit(int ID)
method RollBack (line 206) | internal void RollBack(int ID)
method Insert (line 212) | internal void Insert<T>(Guid guid, T doc)
method SaveAndIndex (line 236) | private void SaveAndIndex(Dictionary<Guid, List<object[]>> rows)
method InsertTransaction (line 246) | internal bool InsertTransaction<T>(Guid docid, T doc)
method Query (line 290) | internal Result<object> Query(string filter, int start, int count, str...
method Query (line 313) | internal Result<object> Query(int start, int count)
method Query (line 318) | internal Result<object> Query(int start, int count, string orderby)
method extractrowobject (line 367) | private void extractrowobject(int count, List<object> rows, ref int sk...
method Shutdown (line 383) | internal void Shutdown()
method Delete (line 430) | internal void Delete(Guid docid)
method CreateResultRowFiller (line 439) | private void CreateResultRowFiller()
method CreateRowFillerDelegate (line 448) | public static RowFill CreateRowFillerDelegate(Type objtype, ViewRowDef...
method isProperty (line 520) | private static bool isProperty(PropertyInfo[] properties, string key, ...
method isField (line 532) | private static bool isField(FieldInfo[] fields, string key, out FieldI...
method extractsortrowobject (line 602) | private void extractsortrowobject(MGRB ba, int count, List<int> orderb...
method OutputRow (line 619) | private bool OutputRow<T>(List<T> rows, int i)
method ReturnRowsTyped (line 632) | private Result<T> ReturnRowsTyped<T>(MGRB ba, List<T> trows, int start...
method extractsortrowT (line 690) | private void extractsortrowT<T>(MGRB ba, int count, List<int> orderby,...
method FastCreateObject (line 709) | private object FastCreateObject(Type objtype)
method RebuildFromScratch (line 735) | private void RebuildFromScratch(IDocStorage<Guid> docs)
method CreateObject (line 797) | private object CreateObject(byte[] b)
method CreateLoadIndexes (line 805) | private void CreateLoadIndexes()
method GenerateSchemaColumns (line 830) | private void GenerateSchemaColumns(ViewBase _view)
method InsertRowsWithIndexUpdate (line 946) | private void InsertRowsWithIndexUpdate(Guid guid, List<object[]> rows)
method ExtractRows (line 968) | private List<object[]> ExtractRows(List<object> rows)
method IndexRow (line 998) | private void IndexRow(Guid docid, object[] row, int rownum)
method CreateIndex (line 1026) | private IIndex CreateIndex(string name, Type type)
method DeleteRowsWith (line 1056) | private void DeleteRowsWith(Guid guid)
method QueryColumnExpression (line 1063) | private MGRB QueryColumnExpression(string colname, RDBExpression exp, ...
method QueryColumnExpressionFromTo (line 1072) | private MGRB QueryColumnExpressionFromTo(string colname, object from, ...
method Count (line 1082) | internal int Count<T>(Expression<Predicate<T>> filter)
method Count (line 1098) | internal int Count(string filter)
method GenerateBitmap (line 1116) | private MGRB GenerateBitmap<T>(Expression<Predicate<T>> filter)
method GenerateBitmap (line 1150) | private MGRB GenerateBitmap(string filter)
method internalCount (line 1190) | private int internalCount() // note : don't use for Not() since _delet...
method QueryWithTypedResult (line 1200) | internal Result<T> QueryWithTypedResult<T>(Expression<Predicate<T>> fi...
method QueryWithTypedResult (line 1236) | internal Result<T> QueryWithTypedResult<T>(string filter, int start, i...
method SortBy (line 1264) | internal List<int> SortBy(string sortcol)
method GetAssembly (line 1304) | internal object GetAssembly(out string typename)
method GetSchema (line 1310) | public ViewRowDefinition GetSchema()
method NextRowNumber (line 1317) | internal int NextRowNumber()
method ViewDelete (line 1327) | internal int ViewDelete<T>(Expression<Predicate<T>> filter)
method WriteDirtyFile (line 1346) | private void WriteDirtyFile()
method ViewDelete (line 1356) | internal int ViewDelete(string filter)
method ViewInsert (line 1378) | internal bool ViewInsert(Guid id, object row)
method InvalidateCaches (line 1390) | private void InvalidateCaches()
FILE: RaptorDB/Views/ViewManager.cs
class ViewManager (line 10) | internal class ViewManager
method ViewManager (line 12) | public ViewManager(string viewfolder, IDocStorage<Guid> objstore, IKey...
method Count (line 38) | internal int Count(string viewname, string filter)
method Query (line 49) | internal Result<object> Query(string viewname, string filter, int star...
method Query (line 54) | internal Result<object> Query(string viewname, int start, int count)
method Insert (line 65) | internal void Insert<T>(string viewname, Guid docid, T data)
method InsertTransaction (line 86) | internal bool InsertTransaction<T>(string viewname, Guid docid, T data)
method Fetch (line 104) | internal object Fetch(Guid guid)
method GetPrimaryViewForType (line 112) | internal string GetPrimaryViewForType(Type type)
method GetOtherViewsList (line 124) | internal List<string> GetOtherViewsList(Type type)
method GetViewName (line 131) | internal string GetViewName(Type type) // used for queries
method RegisterView (line 147) | internal void RegisterView<T>(View<T> view)
method ShutDown (line 181) | internal void ShutDown()
method GetConsistentViews (line 205) | internal List<string> GetConsistentViews(Type type)
method AddToViewList (line 212) | private void AddToViewList(SafeDictionary<Type, List<string>> diclist,...
method Delete (line 229) | internal void Delete(Guid docid)
method Rollback (line 236) | internal void Rollback(int ID)
method Commit (line 246) | internal void Commit(int ID)
method isTransaction (line 256) | internal bool isTransaction(string viewname)
method inTransaction (line 261) | internal bool inTransaction()
method StartTransaction (line 267) | internal void StartTransaction()
method Query (line 272) | internal Result<T> Query<T>(Expression<Predicate<T>> filter, int start...
method Query (line 277) | internal Result<T> Query<T>(Expression<Predicate<T>> filter, int start...
method Query (line 290) | internal Result<T> Query<T>(string filter, int start, int count)
method Query (line 295) | internal Result<T> Query<T>(string filter, int start, int count, strin...
method Count (line 308) | internal int Count<T>(Expression<Predicate<T>> filter)
method FreeMemory (line 321) | internal void FreeMemory()
method GetAssemblyForView (line 327) | internal object GetAssemblyForView(string viewname, out string typename)
method GetViews (line 339) | internal List<ViewBase> GetViews()
method GetSchema (line 347) | internal ViewRowDefinition GetSchema(string view)
method Query (line 357) | internal Result<object> Query(string viewname, string filter, int star...
method ViewDelete (line 368) | internal int ViewDelete<T>(Expression<Predicate<T>> filter)
method ViewDelete (line 381) | internal int ViewDelete(string viewname, string filter)
method ViewInsert (line 390) | internal bool ViewInsert<T>(Guid id, T row)
method ViewInsert (line 403) | internal bool ViewInsert(string viewname, Guid id, object row)
method GetKVHF (line 414) | internal IKeyStoreHF GetKVHF()
FILE: RaptorDB/Views/apimapper.cs
class apimapper (line 7) | internal class apimapper : IMapAPI
method apimapper (line 9) | public apimapper(ViewManager man, ViewHandler vhandler)
method Log (line 22) | public void Log(string message)
method Fetch (line 27) | public object Fetch(Guid guid)
method Emit (line 32) | public void Emit(Guid docid, params object[] data)
method EmitObject (line 58) | public void EmitObject<T>(Guid docid, T doc)
method RollBack (line 84) | public void RollBack()
method Count (line 89) | public int Count(string viewname)
method Count (line 94) | public int Count(string ViewName, string Filter)
method Query (line 99) | public Result<T> Query<T>(Expression<Predicate<T>> Filter)
method Query (line 104) | public Result<T> Query<T>(Expression<Predicate<T>> Filter, int start, ...
method Query (line 109) | public Result<T> Query<T>(string Filter)
method Query (line 114) | public Result<T> Query<T>(string Filter, int start, int count)
method Count (line 119) | public int Count<T>(Expression<Predicate<T>> Filter)
method NextRowNumber (line 124) | public int NextRowNumber()
method GetKVHF (line 129) | public Common.IKeyStoreHF GetKVHF()
method Fetch (line 134) | public T Fetch<T>(Guid guid) where T : class
FILE: RaptorDB/WEB/bundle.js
function t (line 1) | function t(){}
function n (line 1) | function n(t,e){for(const n in e)t[n]=e[n];return t}
function o (line 1) | function o(t){return t()}
function c (line 1) | function c(){return Object.create(null)}
function l (line 1) | function l(t){t.forEach(o)}
function a (line 1) | function a(t){return"function"==typeof t}
function i (line 1) | function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function...
function r (line 1) | function r(t,e,n){if(t){const o=s(t,e,n);return t[0](o)}}
function s (line 1) | function s(t,e,o){return t[1]?n({},n(e.$$scope.ctx,t[1](o?o(e):{}))):e.$...
function d (line 1) | function d(t,e,o,c){return t[1]?n({},n(e.$$scope.changed||{},t[1](c?c(o)...
function m (line 1) | function m(){f.forEach(t=>{t[0](u())||(f.delete(t),t[1]())}),(h=f.size>0...
function g (line 1) | function g(t,e){t.appendChild(e)}
function b (line 1) | function b(t,e,n){t.insertBefore(e,n||null)}
function w (line 1) | function w(t){t.parentNode.removeChild(t)}
function $ (line 1) | function $(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}
function x (line 1) | function x(t){return document.createElement(t)}
function y (line 1) | function y(t){return document.createTextNode(t)}
function k (line 1) | function k(){return y(" ")}
function _ (line 1) | function _(){return y("")}
function C (line 1) | function C(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventLi...
function S (line 1) | function S(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}
function j (line 1) | function j(t,e){e=""+e,t.data!==e&&(t.data=e)}
function O (line 1) | function O(t,e,n){t.style.setProperty(e,n)}
function D (line 1) | function D(t,e){for(let n=0;n<t.options.length;n+=1){const o=t.options[n...
function L (line 1) | function L(t){const e=t.querySelector(":checked")||t.options[0];return e...
function N (line 1) | function N(t,e,n){t.classList[n?"add":"remove"](e)}
function V (line 1) | function V(t,e){const n=document.createEvent("CustomEvent");return n.ini...
function B (line 1) | function B(t,e,n,o,c,l,a,i=0){const r=16.666/o;let s="{\n";for(let t=0;t...
function E (line 1) | function E(t,e){t.style.animation=(t.style.animation||"").split(", ").fi...
function q (line 1) | function q(t){I=t}
function R (line 1) | function R(t){(function(){if(!I)throw new Error("Function called outside...
function F (line 1) | function F(){const t=I;return(e,n)=>{const o=t.$$.callbacks[e];if(o){con...
function A (line 1) | function A(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(t=>t...
function X (line 1) | function X(){K||(K=!0,J.then(Z))}
function Q (line 1) | function Q(){return X(),J}
function W (line 1) | function W(t){z.push(t)}
function Y (line 1) | function Y(t){U.push(t)}
function Z (line 1) | function Z(){const t=new Set;do{for(;G.length;){const t=G.shift();q(t),t...
function tt (line 1) | function tt(t){t.fragment&&(t.update(t.dirty),l(t.before_update),t.fragm...
function et (line 1) | function et(t,e,n){t.dispatchEvent(V(`${e?"intro":"outro"}${n}`))}
function ct (line 1) | function ct(){ot={r:0,c:[],p:ot}}
function lt (line 1) | function lt(){ot.r||l(ot.c),ot=ot.p}
function at (line 1) | function at(t,e){t&&t.i&&(nt.delete(t),t.i(e))}
function it (line 1) | function it(t,e,n,o){if(t&&t.o){if(nt.has(t))return;nt.add(t),ot.c.push(...
function rt (line 1) | function rt(n,o,c,i){let r=o(n,c),s=i?0:1,d=null,p=null,g=null;function ...
function st (line 1) | function st(t,e){t.d(1),e.delete(t.key)}
function dt (line 1) | function dt(t,e,n,o,c,l,a,i,r,s,d,u){let v=t.length,f=l.length,p=v;const...
function ut (line 1) | function ut(t,e,n){-1!==t.$$.props.indexOf(e)&&(t.$$.bound[e]=n,n(t.$$.c...
function vt (line 1) | function vt(t,e,n){const{fragment:c,on_mount:i,on_destroy:r,after_update...
function ft (line 1) | function ft(t,e){t.$$.fragment&&(l(t.$$.on_destroy),t.$$.fragment.d(e),t...
function pt (line 1) | function pt(e,n,o,a,i,r){const s=I;q(e);const d=n.props||{},u=e.$$={frag...
class ht (line 1) | class ht{$destroy(){ft(this,1),this.$destroy=t}$on(t,e){const n=this.$$....
method $destroy (line 1) | $destroy(){ft(this,1),this.$destroy=t}
method $on (line 1) | $on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);retur...
method $set (line 1) | $set(){}
function mt (line 1) | function mt(t,e,n){const o=Object.create(t);return o.panel=e[n],o}
function gt (line 1) | function gt(t,e,n){const o=Object.create(t);return o.name=e[n],o}
function bt (line 1) | function bt(t){var e,n,o,c=t.panel.description;function l(){return t.cli...
function wt (line 1) | function wt(t){var e,n,o,c,l,a,i=t.name;function r(){return t.click_hand...
function $t (line 1) | function $t(e){for(var n,o,c,l=Object.keys(e.navdata),a=[],i=0;i<l.lengt...
function xt (line 1) | function xt(t,e,n){const o=F();let c="";function l(t){n("activepanel",c=...
class yt (line 1) | class yt extends ht{constructor(t){super(),pt(this,t,xt,$t,i,[])}}
method constructor (line 1) | constructor(t){super(),pt(this,t,xt,$t,i,[])}
function kt (line 1) | function kt(t){var e;return{c(){(e=x("div")).innerHTML="<h2>Welcome to t...
function _t (line 1) | function _t(e){var n,o=e.active&&kt(e);return{c(){o&&o.c(),n=_()},m(t,e)...
function Ct (line 1) | function Ct(t,e,n){let{active:o=!1}=e;return t.$set=(t=>{"active"in t&&n...
class St (line 1) | class St extends ht{constructor(t){super(),pt(this,t,Ct,_t,i,["active"])...
method constructor (line 1) | constructor(t){super(),pt(this,t,Ct,_t,i,["active"])}
method active (line 1) | get active(){return this.$$.ctx.active}
method active (line 1) | set active(t){this.$set({active:t}),Z()}
function jt (line 1) | function jt(t,e,n){const o=Object.create(t);return o.r=e[n],o}
function Ot (line 1) | function Ot(t,e,n){const o=Object.create(t);return o.row=e[n],o}
function Dt (line 1) | function Dt(t,e,n){const o=Object.create(t);return o.col=e[n],o}
function Lt (line 1) | function Lt(e){var n;return{c(){(n=x("p")).textContent="No data"},m(t,e)...
function Nt (line 1) | function Nt(t){var e,n,o,c,a,i,r,s,d,u,v,f,p,h,m,_,D,L,N,V,I,T,M,B,E,q,R...
function Vt (line 1) | function Vt(t,e){var n,o,c,l=e.col;function a(){return e.click_handler(e...
function It (line 1) | function It(t){var e,n=t.row[t.r];return{c(){e=y(n)},m(t,n){b(t,e,n)},p(...
function Tt (line 1) | function Tt(t){var e,n,o,c=t.row[t.r];function l(){return t.click_handle...
function Mt (line 1) | function Mt(t,e){var n;function o(t){return"docid"===t.r?Tt:It}var c=o(e...
function Bt (line 1) | function Bt(t){var e,n,o=[],c=new Map,l=Object.keys(t.row);const a=t=>t....
function Et (line 1) | function Et(e){var n;function o(t){return null!==t.rows&&t.rows.length>0...
function qt (line 1) | function qt(t,e,n){let{rows:o=[],totalrows:c=1,page:l=1}=e;const a=F();l...
class Rt (line 1) | class Rt extends ht{constructor(t){super(),pt(this,t,qt,Et,i,["rows","to...
method constructor (line 1) | constructor(t){super(),pt(this,t,qt,Et,i,["rows","totalrows","page"])}
function Ft (line 1) | function Ft(t,e,n){const o=Object.create(t);return o.col=e[n],o}
function At (line 1) | function At(t,e,n){const o=Object.create(t);return o.vn=e[n],o}
function Gt (line 1) | function Gt(t){var e,n,o,c,a,i,r,s,d,u,v,f,p,h,m,$,y,_,j,L,V,I,T,M,B,E,q...
function Ht (line 1) | function Ht(t,e){var n,o,c,l=e.vn;return{key:t,first:null,c(){n=x("optio...
function zt (line 1) | function zt(t,e){var n,o,c,l,a=e.col;function i(){return e.click_handler...
function Ut (line 1) | function Ut(e){var n,o;return{c(){n=x("p"),o=y(e.errormsg),O(n,"color","...
function Jt (line 1) | function Jt(t){var e,n,o,c,l,a=null!=t.data&&Pt(t);function i(e){t.datat...
function Pt (line 1) | function Pt(t){var e,n,o;return{c(){e=x("pre"),n=y("Query time (+render)...
function Kt (line 1) | function Kt(t){var e,n,o=t.active&&Gt(t);return{c(){o&&o.c(),e=_()},m(t,...
function Xt (line 1) | function Xt(t,e,n){let{active:o=!1}=e,c="",l=[],a=[],i=null,r=0,s=10,d="...
class Qt (line 1) | class Qt extends ht{constructor(t){super(),pt(this,t,Xt,Kt,i,["active"])...
method constructor (line 1) | constructor(t){super(),pt(this,t,Xt,Kt,i,["active"])}
method active (line 1) | get active(){return this.$$.ctx.active}
method active (line 1) | set active(t){this.$set({active:t}),Z()}
function Wt (line 1) | function Wt(t,e,n){const o=Object.create(t);return o.l=e[n],o}
function Yt (line 1) | function Yt(t){var e,n,o,c,l,a,i,r,s,d,u,v,f,p,h,m,$,_,O,D,L,V,I,T,M,B,E...
function Zt (line 1) | function Zt(t,e){var n,o,c=e.l;return{key:t,first:null,c(){n=x("div"),o=...
function te (line 1) | function te(e){var n,o=e.active&&Yt(e);return{c(){o&&o.c(),n=_()},m(t,e)...
function ee (line 1) | function ee(t,e,n){let{active:o=!1}=e,c=0,l=0,a=0,i=0,r=0,s=0,d=0,u=0,v=...
class ne (line 1) | class ne extends ht{constructor(t){super(),pt(this,t,ee,te,i,["active"])...
method constructor (line 1) | constructor(t){super(),pt(this,t,ee,te,i,["active"])}
method active (line 1) | get active(){return this.$$.ctx.active}
method active (line 1) | set active(t){this.$set({active:t}),Z()}
function oe (line 1) | function oe(t,e,n){const o=Object.create(t);return o.v=e[n],o}
function ce (line 1) | function ce(t){var e,n,o,c,a,i,r,s,d,u,v,f,p,h,m,$,_,D,L,V=t.total>0&&le...
function le (line 1) | function le(t){var e,n,o,c,a,i,r,s,d,u,v,f,p,h,m,$,_,D,L,N,V,I,T,M,B=[],...
function ae (line 1) | function ae(t,e){var n,o,c,l,a,i=e.v;function r(){return e.click_handler...
function ie (line 1) | function ie(e){var n,o=e.active&&ce(e);return{c(){o&&o.c(),n=_()},m(t,e)...
function se (line 1) | function se(t,e,n){let o,{active:c=!1}=e,l="",a=1,i=[],r="",s=0,d=0;func...
class de (line 1) | class de extends ht{constructor(t){super(),pt(this,t,se,ie,i,["active"])...
method constructor (line 1) | constructor(t){super(),pt(this,t,se,ie,i,["active"])}
method active (line 1) | get active(){return this.$$.ctx.active}
method active (line 1) | set active(t){this.$set({active:t}),Z()}
function ue (line 1) | function ue(t){var e,n,o,c,a,i,r,s,d,u,v,f,p=""!==t.doc&&ve(t);return{c(...
function ve (line 1) | function ve(t){var e,n,o,c,l,a,i,r,s,d,u,v,f,p,h;return{c(){e=x("div"),(...
function fe (line 1) | function fe(e){var n,o=e.active&&ue(e);return{c(){o&&o.c(),n=_()},m(t,e)...
function pe (line 1) | function pe(t,e,n){let{active:o=!1,docid:c=null}=e,l="";const a=F();func...
class he (line 1) | class he extends ht{constructor(t){super(),pt(this,t,pe,fe,i,["active","...
method constructor (line 1) | constructor(t){super(),pt(this,t,pe,fe,i,["active","docid"])}
method active (line 1) | get active(){return this.$$.ctx.active}
method active (line 1) | set active(t){this.$set({active:t}),Z()}
method docid (line 1) | get docid(){return this.$$.ctx.docid}
method docid (line 1) | set docid(t){this.$set({docid:t}),Z()}
function me (line 1) | function me(t,e,n){const o=Object.create(t);return o.v=e[n],o}
function ge (line 1) | function ge(t){var e,n,o,c,a,i,r,s,d,u,v,f,p,h,m,$,_,D=t.versions.length...
function be (line 1) | function be(t){var e,n,o,c,l,a,i,r,s,d=[],u=new Map,v=t.versions;const f...
function we (line 1) | function we(t,e){var n,o,c,l,a,i,r,s=e.v.Version,d=e.v.ChangeDate;functi...
function $e (line 1) | function $e(e){var n,o=e.active&&ge(e);return{c(){o&&o.c(),n=_()},m(t,e)...
function xe (line 1) | function xe(t,e,n){let{active:o=!1,docid:c=null}=e,l="",a=[];function i(...
class ye (line 1) | class ye extends ht{constructor(t){super(),pt(this,t,xe,$e,i,["active","...
method constructor (line 1) | constructor(t){super(),pt(this,t,xe,$e,i,["active","docid"])}
method active (line 1) | get active(){return this.$$.ctx.active}
method active (line 1) | set active(t){this.$set({active:t}),Z()}
method docid (line 1) | get docid(){return this.$$.ctx.docid}
method docid (line 1) | set docid(t){this.$set({docid:t}),Z()}
function ke (line 1) | function ke(t,e,n){const o=Object.create(t);return o.v=e[n],o}
function _e (line 1) | function _e(t){var e,n,o,c,a,i,r,s,d,u,v,f,p,h,m,$,_,D,L,V,I,T,M,B,E,q,R...
function Ce (line 1) | function Ce(t,e){var n,o,c,l,a,i=e.v;function r(){return e.click_handler...
function Se (line 1) | function Se(e){var n,o=e.active&&_e(e);return{c(){o&&o.c(),n=_()},m(t,e)...
function Oe (line 1) | function Oe(t,e,n){let o,{active:c=!1}=e,l="",a=[],i="",r=0,s=0,d=1;func...
class De (line 1) | class De extends ht{constructor(t){super(),pt(this,t,Oe,Se,i,["active"])...
method constructor (line 1) | constructor(t){super(),pt(this,t,Oe,Se,i,["active"])}
method active (line 1) | get active(){return this.$$.ctx.active}
method active (line 1) | set active(t){this.$set({active:t}),Z()}
function Le (line 1) | function Le(t,e,n){const o=Object.create(t);return o.fc=e[n],o}
function Ne (line 1) | function Ne(t,e,n){const o=Object.create(t);return o.fc=e[n],o}
function Ve (line 1) | function Ve(t,e,n){const o=Object.create(t);return o.fc=e[n],o}
function Ie (line 1) | function Ie(t,e,n){const o=Object.create(t);return o.fc=e[n],o}
function Te (line 1) | function Te(t,e,n){const o=Object.create(t);return o.sc=e[n],o}
function Me (line 1) | function Me(t,e,n){const o=Object.create(t);return o.vn=e[n],o}
function Be (line 1) | function Be(t){var e,n,o,c,a,i,r,s,d,u,v,f,p,h,m,$,_,L,V,I,T,M,B,E,q,R,F...
function Ee (line 1) | function Ee(t,e){var n,o,c,l=e.vn;return{key:t,first:null,c(){n=x("optio...
function qe (line 1) | function qe(t,e){var n,o,c,l,a,i,r,s=e.sc,d=e.schema[e.sc];return{key:t,...
function Re (line 1) | function Re(t,e){var n,o,c=e.fc;return{key:t,first:null,c(){n=x("label")...
function Fe (line 1) | function Fe(t,e){var n,o,c=e.fc;return{key:t,first:null,c(){n=x("label")...
function Ae (line 1) | function Ae(t,e){var n,o,c=e.fc;return{key:t,first:null,c(){n=x("label")...
function Ge (line 1) | function Ge(t,e){var n,o,c=e.fc;return{key:t,first:null,c(){n=x("label")...
function He (line 1) | function He(e){var n,o=e.active&&Be(e);return{c(){o&&o.c(),n=_()},m(t,e)...
function ze (line 1) | function ze(t,e,n){let{active:o=!1}=e,c="",l=[],a={},i=[],r=[],s=[],d=[]...
class Ue (line 1) | class Ue extends ht{constructor(t){super(),pt(this,t,ze,He,i,["active"])...
method constructor (line 1) | constructor(t){super(),pt(this,t,ze,He,i,["active"])}
method active (line 1) | get active(){return this.$$.ctx.active}
method active (line 1) | set active(t){this.$set({active:t}),Z()}
function Je (line 1) | function Je(t){var e,n,o,c,l,a;return{c(){e=x("div"),(n=x("h2")).textCon...
function Pe (line 1) | function Pe(e){var n,o=e.active&&Je(e);return{c(){o&&o.c(),n=_()},m(t,e)...
function Ke (line 1) | function Ke(t,e,n){let{active:o=!1}=e,c="";return R(()=>{window.LOAD("/r...
class Xe (line 1) | class Xe extends ht{constructor(t){super(),pt(this,t,Ke,Pe,i,["active"])...
method constructor (line 1) | constructor(t){super(),pt(this,t,Ke,Pe,i,["active"])}
method active (line 1) | get active(){return this.$$.ctx.active}
method active (line 1) | set active(t){this.$set({active:t}),Z()}
function Qe (line 1) | function Qe(t){const e=t-1;return e*e*e+1}
function We (line 1) | function We(t,{delay:e=0,duration:n=400}){const o=+getComputedStyle(t).o...
function Ye (line 1) | function Ye(t,{delay:e=0,duration:n=400,easing:o=Qe,x:c=0,y:l=0,opacity:...
function Ze (line 1) | function Ze(t){var e,n,o,c;const l=t.$$slots.default,a=r(l,t,null);retur...
function tn (line 1) | function tn(t){var e,n;const o=t.$$slots.default,c=r(o,t,null);return{c(...
function en (line 1) | function en(t){var e,n,o,c,l=[tn,Ze],a=[];function i(t){return t.href?0:...
function nn (line 1) | function nn(t,e,n){let{type:o="button",href:c=null,mode:l=null,color:a=n...
class on (line 1) | class on extends ht{constructor(t){super(),pt(this,t,nn,en,i,["type","hr...
method constructor (line 1) | constructor(t){super(),pt(this,t,nn,en,i,["type","href","mode","color"...
function an (line 1) | function an(t){var e;return{c(){e=y("Close")},m(t,n){b(t,e,n)},d(t){t&&w...
function rn (line 1) | function rn(t){var e,n,o,c,l,a,i,u,v,f,p,h,m;const $=t.$$slots.default,_...
function sn (line 1) | function sn(t,e,n){let{title:o}=e;const c=F();let{$$slots:l={},$$scope:a...
class dn (line 1) | class dn extends ht{constructor(t){super(),pt(this,t,sn,rn,i,["title"])}}
method constructor (line 1) | constructor(t){super(),pt(this,t,sn,rn,i,["title"])}
function un (line 1) | function un(t,e,n){const o=Object.create(t);return o.tab=e[n],o}
function vn (line 1) | function vn(t){var e,n;function o(){return t.click_handler(t)}return{c()...
function fn (line 1) | function fn(t,e){var n,o,c,l,a,i,r,s,d=e.tab.title,u="Help"!==e.tab.titl...
function pn (line 1) | function pn(t){var e,n=new dn({props:{title:t.title,$$slots:{default:[wn...
function hn (line 1) | function hn(t){var e,n=new on({props:{type:"button",$$slots:{default:[mn...
function mn (line 1) | function mn(t){var e;return{c(){e=y("Yes")},m(t,n){b(t,e,n)},d(t){t&&w(e...
function gn (line 1) | function gn(t){var e;return{c(){e=y("Cancel")},m(t,n){b(t,e,n)},d(t){t&&...
function bn (line 1) | function bn(t){var e,n,o,c=t.modalyes&&hn(t),l=new on({props:{type:"butt...
function wn (line 1) | function wn(e){return{c:t,m:t,p:t,i:t,o:t,d:t}}
function $n (line 1) | function $n(t){var e,n,o,c,l,a,i,r,s,d,u,v,f,p=[],h=new Map,m=new yt({})...
function xn (line 1) | function xn(t,e,n){let o="",c=[],l=!1,a="",i=!1;function r(t,e){var l=do...
method constructor (line 1) | constructor(t){super(),pt(this,t,xn,$n,i,[])}
FILE: RaptorDB/cron/CronDaemon.cs
class CronDaemon (line 8) | public class CronDaemon
method CronDaemon (line 14) | public CronDaemon()
method AddJob (line 21) | public void AddJob(string schedule, ThreadStart action)
method Stop (line 38) | public void Stop()
method timer_elapsed (line 46) | private void timer_elapsed(object sender, ElapsedEventArgs e)
FILE: RaptorDB/cron/CronJob.cs
class CronJob (line 6) | internal class CronJob
method CronJob (line 12) | public CronJob(string schedule, ThreadStart thread_start)
method execute (line 20) | public void execute(DateTime date_time)
method abort (line 35) | public void abort()
FILE: RaptorDB/cron/CronSchedule.cs
class CronSchedule (line 7) | internal class CronSchedule
method CronSchedule (line 32) | public CronSchedule()
method CronSchedule (line 36) | public CronSchedule(string expressions)
method isValid (line 46) | private bool isValid()
method isValid (line 51) | public bool isValid(string expression)
method isTime (line 57) | public bool isTime(DateTime date_time)
method generate (line 66) | private void generate()
method generate_minutes (line 95) | private void generate_minutes(string match)
method generate_hours (line 100) | private void generate_hours(string match)
method generate_days_of_month (line 105) | private void generate_days_of_month(string match)
method generate_months (line 110) | private void generate_months(string match)
method generate_days_of_weeks (line 115) | private void generate_days_of_weeks(string match)
method generate_values (line 120) | private List<int> generate_values(string configuration, int start, int...
method divided_array (line 130) | private List<int> divided_array(string configuration, int start, int max)
method range_array (line 146) | private List<int> range_array(string configuration)
method wild_array (line 175) | private List<int> wild_array(string configuration, int start, int max)
method list_array (line 188) | private List<int> list_array(string configuration)
FILE: RaptorDBCore/test/sample.cs
class LineItem (line 17) | public class LineItem
class SalesInvoice (line 25) | public class SalesInvoice
method SalesInvoice (line 27) | public SalesInvoice()
class SalesInvoiceViewRowSchema (line 45) | public class SalesInvoiceViewRowSchema : RDBSchema
class SalesInvoiceView (line 56) | [RegisterView]
method SalesInvoiceView (line 59) | public SalesInvoiceView()
class Program (line 84) | class Program
method Main (line 88) | static void Main(string[] args)
method DoWork (line 104) | static void DoWork()
method CreateInvoice (line 131) | static SalesInvoice CreateInvoice(int counter)
FILE: RaptorDBServer/Installer.cs
class CustomServiceInstaller (line 7) | [RunInstaller(true)]
method CustomServiceInstaller (line 13) | public CustomServiceInstaller()
method OnBeforeInstall (line 26) | protected override void OnBeforeInstall(System.Collections.IDictionary...
FILE: RaptorDBServer/Program.cs
class Program (line 9) | static class Program
method Main (line 17) | static void Main(string[] args)
method Dostart (line 78) | private static void Dostart()
method IsServiceInstalled (line 86) | private static bool IsServiceInstalled(string serviceName)
FILE: RaptorDBServer/Service1.Designer.cs
class Service1 (line 3) | partial class Service1
method Dispose (line 14) | protected override void Dispose(bool disposing)
method InitializeComponent (line 29) | private void InitializeComponent()
FILE: RaptorDBServer/Service1.cs
class Service1 (line 6) | public partial class Service1 : ServiceBase
method Service1 (line 8) | public Service1()
method OnStart (line 15) | protected override void OnStart(string[] args)
method OnStop (line 21) | protected override void OnStop()
method OnShutdown (line 26) | protected override void OnShutdown()
FILE: Views/Class1.cs
class LineItem (line 16) | public class LineItem
class SalesInvoice (line 24) | public class SalesInvoice
method SalesInvoice (line 26) | public SalesInvoice()
class TestData (line 46) | public class TestData
class TestSchema (line 53) | public class TestSchema : RDBSchema
class TestView (line 59) | public class TestView : View<TestData>
method TestView (line 61) | public TestView()
class SalesInvoiceViewRowSchema (line 77) | [RegisterView]
class SalesInvoiceView (line 93) | [RegisterView]
method SalesInvoiceView (line 96) | public SalesInvoiceView()
class SalesItemRowsViewRowSchema (line 125) | public class SalesItemRowsViewRowSchema : RDBSchema
class SalesItemRowsView (line 133) | [RegisterView]
method SalesItemRowsView (line 136) | public SalesItemRowsView()
class NewViewRowSchema (line 155) | public class NewViewRowSchema : RDBSchema
class newview (line 163) | [RegisterView]
method newview (line 166) | public newview()
FILE: Views/ServerSide.cs
class ServerSide (line 8) | public class ServerSide
class sumtype (line 12) | public class sumtype : RaptorDB.BindableFields
method Sum_Products_based_on_filter (line 19) | public static List<object> Sum_Products_based_on_filter(IRaptorDB rap,...
method Sum_Products_based_on_filter_args (line 35) | public static List<object> Sum_Products_based_on_filter_args(IRaptorDB...
FILE: datagridbinding/Program.cs
class Program (line 8) | static class Program
method DoubleBuffered (line 10) | public static void DoubleBuffered(this DataGridView dgv, bool setting)
method Main (line 19) | [STAThread]
FILE: datagridbinding/frmMain.Designer.cs
class frmMain (line 3) | partial class frmMain
method Dispose (line 14) | protected override void Dispose(bool disposing)
method InitializeComponent (line 29) | private void InitializeComponent()
FILE: datagridbinding/frmMain.cs
class frmMain (line 10) | public partial class frmMain : Form
method frmMain (line 12) | public frmMain()
method Form1_Load (line 20) | private void Form1_Load(object sender, EventArgs e)
method TextBox1KeyPress (line 32) | void TextBox1KeyPress(object sender, KeyPressEventArgs e)
method Query (line 38) | private void Query()
method sumQueryToolStripMenuItem_Click (line 62) | private void sumQueryToolStripMenuItem_Click(object sender, EventArgs e)
method exitToolStripMenuItem_Click (line 85) | private void exitToolStripMenuItem_Click(object sender, EventArgs e)
method shutdown (line 90) | private void shutdown()
method insert100000DocumentsToolStripMenuItem_Click (line 98) | private void insert100000DocumentsToolStripMenuItem_Click(object sende...
method CreateInvoice (line 124) | private static SalesInvoice CreateInvoice(int i)
method backupToolStripMenuItem_Click (line 142) | private void backupToolStripMenuItem_Click(object sender, EventArgs e)
method restoreToolStripMenuItem_Click (line 148) | private void restoreToolStripMenuItem_Click(object sender, EventArgs e)
class objclass (line 153) | public class objclass
method serverSideSumQueryToolStripMenuItem_Click (line 158) | private void serverSideSumQueryToolStripMenuItem_Click(object sender, ...
method KVHFtest (line 180) | private void KVHFtest()
class ppp (line 248) | class ppp
method testToolStripMenuItem_Click (line 252) | private void testToolStripMenuItem_Click(object sender, EventArgs e)
method frmMain_FormClosing (line 329) | private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
method freememoryToolStripMenuItem_Click (line 334) | private void freememoryToolStripMenuItem_Click(object sender, EventArg...
method dataGridView1_CellDoubleClick (line 339) | private void dataGridView1_CellDoubleClick(object sender, DataGridView...
FILE: datagridbinding/frmStartup.Designer.cs
class frmStartup (line 3) | partial class frmStartup
method Dispose (line 14) | protected override void Dispose(bool disposing)
method InitializeComponent (line 29) | private void InitializeComponent()
FILE: datagridbinding/frmStartup.cs
class frmStartup (line 8) | public partial class frmStartup : Form
method frmStartup (line 10) | public frmStartup()
method button2_Click (line 17) | private void button2_Click(object sender, EventArgs e)
method button1_Click (line 23) | private void button1_Click(object sender, EventArgs e)
method radioButton1_CheckedChanged (line 41) | private void radioButton1_CheckedChanged(object sender, EventArgs e)
FILE: test script/sample.cs
class LineItem (line 17) | public class LineItem
class SalesInvoice (line 25) | public class SalesInvoice
method SalesInvoice (line 27) | public SalesInvoice()
class SalesInvoiceViewRowSchema (line 45) | public class SalesInvoiceViewRowSchema : RDBSchema
class SalesInvoiceView (line 56) | [RegisterView]
method SalesInvoiceView (line 59) | public SalesInvoiceView()
class Program (line 81) | class Program
method Main (line 85) | static void Main(string[] args)
method DoWork (line 101) | static void DoWork()
method CreateInvoice (line 128) | static SalesInvoice CreateInvoice(int counter)
FILE: testing/program.cs
class program (line 7) | public class program
method Main (line 10) | public static void Main(string[] args)
method Console_CancelKeyPress (line 25) | static void Console_CancelKeyPress(object sender, ConsoleCancelEventAr...
method CurrentDomain_UnhandledException (line 31) | static void CurrentDomain_UnhandledException(object sender, UnhandledE...
Condensed preview — 150 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,298K chars).
[
{
"path": "BuildVersion.cs",
"chars": 158,
"preview": "using System.Reflection;\n// build number = 606\n// build version = 4.0.10\n\n[assembly: AssemblyVersion(\"4.0.0.0\")]\n[assemb"
},
{
"path": "LICENSE",
"chars": 1080,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2014 Mehdi Gholam\n\nPermission is hereby granted, free of charge, to any person obta"
},
{
"path": "README.md",
"chars": 1006,
"preview": "# RaptorDB Document Store\n\nNoSql, JSON based, Document store database with compiled .net map functions and automatic hyb"
},
{
"path": "RaptorDB/AssemblyInfo.cs",
"chars": 467,
"preview": "using System.Reflection;\nusing System.Security;\n\n[assembly: AssemblyTitle(\"RaptorDB Document Store\")]\n[assembly: Assembl"
},
{
"path": "RaptorDB/DataTypes/DataTypes.cs",
"chars": 7535,
"preview": "using System;\nusing RaptorDB.Common;\n\nnamespace RaptorDB\n{\n /// <summary>\n /// Used to track ViewDelete usage for"
},
{
"path": "RaptorDB/Global.cs",
"chars": 5523,
"preview": "namespace RaptorDB\n{\n public class Global\n {\n /// <summary>\n /// Store bitmap as int offsets then s"
},
{
"path": "RaptorDB/Helper/Container.cs",
"chars": 16322,
"preview": "using System.Collections.Generic;\n\nnamespace RaptorDB\n{\n //---------------------------------------------------------"
},
{
"path": "RaptorDB/Helper/MGRB.cs",
"chars": 17026,
"preview": "using RaptorDB.Common;\nusing System;\nusing System.Collections.Generic;\n\nnamespace RaptorDB\n{\n public class MGRB\n "
},
{
"path": "RaptorDB/Helper/WAHBitarray2.cs",
"chars": 19642,
"preview": "using RaptorDB.Common;\nusing System;\nusing System.Collections.Generic;\n\nnamespace RaptorDB\n{\n public class WAHBitArr"
},
{
"path": "RaptorDB/Indexes/BitmapIndex.cs",
"chars": 14570,
"preview": "using RaptorDB.Common;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading;\n\nnamesp"
},
{
"path": "RaptorDB/Indexes/Cache.cs",
"chars": 868,
"preview": "using System;\nusing System.Xml.Serialization;\n\nnamespace RaptorDB\n{\n public enum OPERATION\n {\n AND,\n "
},
{
"path": "RaptorDB/Indexes/Hoot.cs",
"chars": 15999,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing System.Text.RegularExpression"
},
{
"path": "RaptorDB/Indexes/IIndex.cs",
"chars": 526,
"preview": "namespace RaptorDB\n{\n internal enum RDBExpression\n {\n Equal,\n Greater,\n GreaterEqual,\n "
},
{
"path": "RaptorDB/Indexes/ITokenizer.cs",
"chars": 165,
"preview": "using System.Collections.Generic;\n\nnamespace RaptorDB\n{\n public interface ITokenizer\n {\n Dictionary<string"
},
{
"path": "RaptorDB/Indexes/IndexFile.cs",
"chars": 20032,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing RaptorDB.Common;\nusing System.Threading;\nusing f"
},
{
"path": "RaptorDB/Indexes/Indexes.cs",
"chars": 9049,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace RaptorDB\n{\n #region [ TypeIndexes ]\n "
},
{
"path": "RaptorDB/Indexes/MGIndex.cs",
"chars": 18695,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing RaptorDB.Common;\n\nnamespace RaptorDB\n{\n #regi"
},
{
"path": "RaptorDB/Indexes/tokenizer.cs",
"chars": 3554,
"preview": "using System.Collections.Generic;\n\nnamespace RaptorDB\n{\n class tokenizer : ITokenizer\n {\n public Dictionar"
},
{
"path": "RaptorDB/Properties/Resources.Designer.cs",
"chars": 3387,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code w"
},
{
"path": "RaptorDB/Properties/Resources.resx",
"chars": 6062,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "RaptorDB/REST/aWebServer.cs",
"chars": 9905,
"preview": "using System;\nusing System.Net;\nusing System.Text;\nusing System.IO;\nusing System.Threading.Tasks;\nusing System.Reflecti"
},
{
"path": "RaptorDB/REST/rdbRest.cs",
"chars": 27948,
"preview": "using RaptorDB.Common;\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing"
},
{
"path": "RaptorDB/RaptorDB.cs",
"chars": 61238,
"preview": "using RaptorDB.Common;\nusing RaptorDB.Views;\nusing System;\nusing System.CodeDom.Compiler;\nusing System.Collections.Gene"
},
{
"path": "RaptorDB/RaptorDB.csproj",
"chars": 7029,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.micros"
},
{
"path": "RaptorDB/RaptorDBServer.cs",
"chars": 25788,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing RaptorDB.Common;\nusing System.Reflection;\nusin"
},
{
"path": "RaptorDB/Replication/Configuration.cs",
"chars": 1396,
"preview": "using System.Collections.Generic;\n\nnamespace RaptorDB.Replication\n{\n public class WhereItem\n {\n public str"
},
{
"path": "RaptorDB/Replication/Packets.cs",
"chars": 349,
"preview": "namespace RaptorDB.Replication\n{\n public class ReplicationPacket\n {\n //public int number;\n public s"
},
{
"path": "RaptorDB/Replication/Readme.txt",
"chars": 1203,
"preview": "DATA Folder\n |\n\t |- Replication > (branch mode)\n\t | |-: branch.dat\n\t | |\n\t . |- Inbox >\n"
},
{
"path": "RaptorDB/Replication/ReplicationClient.cs",
"chars": 9791,
"preview": "using System;\nusing System.IO;\nusing System.IO.Compression;\nusing RaptorDB.Common;\nusing System.Text.RegularExpressions"
},
{
"path": "RaptorDB/Replication/ReplicationServer.cs",
"chars": 9845,
"preview": "using System;\nusing RaptorDB.Common;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Text.RegularExpressions"
},
{
"path": "RaptorDB/Replication/msg.txt",
"chars": 248,
"preview": "The following error occurred and the json document is below, you can skip this \ndocument if you wish by incrementing th"
},
{
"path": "RaptorDB/Storage/KeyStore.cs",
"chars": 18356,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing RaptorDB.Common;\n\nnamespace R"
},
{
"path": "RaptorDB/Storage/KeyStoreHF.cs",
"chars": 22402,
"preview": "using RaptorDB.Common;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace R"
},
{
"path": "RaptorDB/Storage/StorageFile.cs",
"chars": 24630,
"preview": "using System;\nusing System.IO;\nusing System.Text;\nusing System.Collections.Generic;\nusing RaptorDB.Common;\nusing fastBin"
},
{
"path": "RaptorDB/Storage/StorageFileHF.cs",
"chars": 9073,
"preview": "using RaptorDB.Common;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading;\n\nnamespa"
},
{
"path": "RaptorDB/Storage/StringHF.cs",
"chars": 8607,
"preview": "using RaptorDB.Common;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace R"
},
{
"path": "RaptorDB/Views/Dynamic.cs",
"chars": 86517,
"preview": "//Copyright (C) Microsoft Corporation. All rights reserved.\n\nusing System.Collections.Generic;\nusing System.Text;\nusin"
},
{
"path": "RaptorDB/Views/LINQQuery.cs",
"chars": 10907,
"preview": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressi"
},
{
"path": "RaptorDB/Views/TaskQueue.cs",
"chars": 1919,
"preview": "using System;\nusing System.Timers;\nusing System.Threading.Tasks;\nusing System.Collections.Concurrent;\n\nnamespace Raptor"
},
{
"path": "RaptorDB/Views/ViewHandler.cs",
"chars": 54443,
"preview": "using fastBinaryJSON;\nusing fastJSON;\nusing RaptorDB.Common;\nusing System;\nusing System.Collections.Generic;\nusing Syst"
},
{
"path": "RaptorDB/Views/ViewManager.cs",
"chars": 13483,
"preview": "using RaptorDB.Common;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq.Expressions;\nusing System.Thre"
},
{
"path": "RaptorDB/Views/apimapper.cs",
"chars": 3632,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq.Expressions;\n\nnamespace RaptorDB.Views\n{\n internal"
},
{
"path": "RaptorDB/WEB/bundle.css",
"chars": 7134,
"preview": ".Container.svelte-obficw{width:100%;backface-visibility:hidden;will-change:overflow}.Left.svelte-obficw,.Middle.svelte-o"
},
{
"path": "RaptorDB/WEB/bundle.js",
"chars": 62755,
"preview": "var app=function(){\"use strict\";function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function "
},
{
"path": "RaptorDB/WEB/global.css",
"chars": 649,
"preview": "body {\n font-family: sans-serif;\n color: #222;\n background: #414141;\n}\n\n.tab-content {\n background-color: wh"
},
{
"path": "RaptorDB/WEB/index.html",
"chars": 338,
"preview": "<html>\n<head>\n\t<meta charset='utf8'>\n\t<meta name='viewport' content='width=device-width'>\n\n\t<title>RaptorDB WebStudio</t"
},
{
"path": "RaptorDB/cron/CronDaemon.cs",
"chars": 1487,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Timers;\nusing System.Threading;\n\nnamespace RaptorDB\n{\n p"
},
{
"path": "RaptorDB/cron/CronJob.cs",
"chars": 1075,
"preview": "using System;\nusing System.Threading;\n\nnamespace RaptorDB\n{\n internal class CronJob\n {\n internal readonly C"
},
{
"path": "RaptorDB/cron/CronSchedule.cs",
"chars": 6057,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text.RegularExpressions;\n\nnamespace RaptorDB\n{\n internal"
},
{
"path": "RaptorDB.Common/DataTypes.cs",
"chars": 2160,
"preview": "using System;\nusing System.Collections.Generic;\n\nnamespace RaptorDB\n{\n /// <summary>\n /// Result of queries\n /"
},
{
"path": "RaptorDB.Common/FieldDescriptor.cs",
"chars": 5404,
"preview": "using System;\nusing System.Reflection;\nusing System.ComponentModel;\n\nnamespace RaptorDB\n{\n internal class FieldPrope"
},
{
"path": "RaptorDB.Common/IRaptorDB.cs",
"chars": 13499,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq.Expressions;\n\nnamespace RaptorDB.Common\n{\n public "
},
{
"path": "RaptorDB.Common/Interfaces.cs",
"chars": 5546,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq.Expressions;\nusing RaptorDB.Common;\n\nnamespace Raptor"
},
{
"path": "RaptorDB.Common/LINQString.cs",
"chars": 6519,
"preview": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressi"
},
{
"path": "RaptorDB.Common/Logger.cs",
"chars": 12038,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Threading;\nusing System.IO;\nusing Rapto"
},
{
"path": "RaptorDB.Common/MiniLZO.cs",
"chars": 27961,
"preview": "/**\n * \n * Modifications by Simon Hewitt\n * - change constructors/methods to return byte[]\n * - append original source"
},
{
"path": "RaptorDB.Common/MurMurHash2.cs",
"chars": 4881,
"preview": "using System;\n\nnamespace RaptorDB.Common\n{\n //internal static class murmur3\n //{\n // private static uint se"
},
{
"path": "RaptorDB.Common/NetworkClient.cs",
"chars": 8399,
"preview": "using System;\nusing System.Net.Sockets;\nusing System.Threading;\nusing System.Net;\nusing System.Threading.Tasks;\n\nnamesp"
},
{
"path": "RaptorDB.Common/Packets.cs",
"chars": 1205,
"preview": "using System;\n\nnamespace RaptorDB.Common\n{\n public class Packet\n {\n public Packet()\n {\n "
},
{
"path": "RaptorDB.Common/Properties/AssemblyInfo.cs",
"chars": 227,
"preview": "using System.Reflection;\nusing System.Security;\n\n[assembly: AssemblyTitle(\"RaptorDB.Common\")]\n[assembly: AssemblyDescri"
},
{
"path": "RaptorDB.Common/RaptorDB.Common.csproj",
"chars": 4066,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microso"
},
{
"path": "RaptorDB.Common/RaptorDBClient.cs",
"chars": 29854,
"preview": "using System;\nusing System.Linq;\nusing System.Text;\nusing RaptorDB.Common;\nusing System.Linq.Expressions;\nusing System."
},
{
"path": "RaptorDB.Common/SafeDictionary.cs",
"chars": 9651,
"preview": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\nusing "
},
{
"path": "RaptorDB.Common/View.cs",
"chars": 4676,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Xml.Serialization;\n\nnamespace RaptorDB\n{\n public abstra"
},
{
"path": "RaptorDB.Common/ZipStorer.cs",
"chars": 37840,
"preview": "// ZipStorer, by Jaime Olivares\n// Website: zipstorer.codeplex.com\n// Version: 2.35 (March 14, 2010)\n\nusing System;\nusin"
},
{
"path": "RaptorDB.Common/fastBinaryJSON/BJSON.cs",
"chars": 34270,
"preview": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n#if !SILVERLIGHT\nusing System.Data;\n#endif\nus"
},
{
"path": "RaptorDB.Common/fastBinaryJSON/BJsonParser.cs",
"chars": 10653,
"preview": "using fastJSON;\nusing System;\nusing System.Collections.Generic;\n\nnamespace fastBinaryJSON\n{\n internal sealed class BJ"
},
{
"path": "RaptorDB.Common/fastBinaryJSON/BJsonSerializer.cs",
"chars": 21725,
"preview": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n#if !SILVERLIGHT\nusing System.Data;\n#endif\nus"
},
{
"path": "RaptorDB.Common/fastBinaryJSON/Helper.cs",
"chars": 2639,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace fastBinaryJSON\n{\n i"
},
{
"path": "RaptorDB.Common/fastBinaryJSON/dynamic.cs",
"chars": 2721,
"preview": "#if NET4\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Dynamic;\n\nnamespace fas"
},
{
"path": "RaptorDB.Common/fastJSON/Formatter.cs",
"chars": 2492,
"preview": "using System.Text;\n\nnamespace fastJSON\n{\n internal static class Formatter\n {\n //private static string _ind"
},
{
"path": "RaptorDB.Common/fastJSON/Getters.cs",
"chars": 203,
"preview": "using System.Collections.Generic;\n\nnamespace fastJSON\n{\n public sealed class DatasetSchema\n {\n public List"
},
{
"path": "RaptorDB.Common/fastJSON/Helper.cs",
"chars": 9659,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\n\nnamespace fastJSON\n{\n //publi"
},
{
"path": "RaptorDB.Common/fastJSON/JSON.cs",
"chars": 42313,
"preview": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n#if !SILVERLIGHT\nusing System.Data;\n#endif\nus"
},
{
"path": "RaptorDB.Common/fastJSON/JsonParser.cs",
"chars": 14380,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text;\n\nnamespace fastJSON\n{\n\n "
},
{
"path": "RaptorDB.Common/fastJSON/JsonSerializer.cs",
"chars": 22827,
"preview": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n#if !SILVERLIGHT\nusing System.Data;\n#endif\nus"
},
{
"path": "RaptorDB.Common/fastJSON/Reflection.cs",
"chars": 34071,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Reflection.Emit;\nusing System.Reflection;\nusing System.Col"
},
{
"path": "RaptorDB.Common/fastJSON/dynamic.cs",
"chars": 2777,
"preview": "#if NET4\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Dynamic;\nusing System.L"
},
{
"path": "RaptorDBCore/RaptorDB/RaptorDB.csproj",
"chars": 5612,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n <PropertyGroup>\n <TargetFramework>netstandard2.0</TargetFramework>\n <SignAssem"
},
{
"path": "RaptorDBCore/RaptorDb.Common/RaptorDb.Common.csproj",
"chars": 3459,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n <TargetFramework>netstandard2.0</TargetFramework>\n <SignAsse"
},
{
"path": "RaptorDBCore/test/sample.cs",
"chars": 4457,
"preview": "// ref : ..\\output\\raptordb.dll\n// ref : ..\\output\\raptordb.common.dll\n// ref : ..\\faker.dll\nusing System;\nusing System."
},
{
"path": "RaptorDBCore/test/test.csproj",
"chars": 462,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n <OutputType>Exe</OutputType>\n <TargetFramework>netcoreapp2.0"
},
{
"path": "RaptorDBServer/Installer.cs",
"chars": 981,
"preview": "using System.ComponentModel;\nusing System.Configuration.Install;\nusing System.ServiceProcess;\n\nnamespace RaptorDBServer"
},
{
"path": "RaptorDBServer/Program.cs",
"chars": 3104,
"preview": "using System;\nusing System.ServiceProcess;\nusing System.IO;\nusing System.Reflection;\nusing System.Configuration.Install"
},
{
"path": "RaptorDBServer/Properties/AssemblyInfo.cs",
"chars": 201,
"preview": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"RaptorDBServer\")]\n[assembly: AssemblyDescription(\"Stand alone serve"
},
{
"path": "RaptorDBServer/RaptorDBServer.csproj",
"chars": 4432,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microso"
},
{
"path": "RaptorDBServer/Service1.Designer.cs",
"chars": 1063,
"preview": "namespace RaptorDBServer\n{\n partial class Service1\n {\n /// <summary> \n /// Required designer variab"
},
{
"path": "RaptorDBServer/Service1.cs",
"chars": 707,
"preview": "using System.ServiceProcess;\nusing System.IO;\n\nnamespace RaptorDBServer\n{\n public partial class Service1 : ServiceBa"
},
{
"path": "RaptorDBServer/Service1.resx",
"chars": 5874,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "RaptorDBTest.sln",
"chars": 6631,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.25420.1\nMini"
},
{
"path": "RaptorDB_Doc.nuspec",
"chars": 1608,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd\">\n "
},
{
"path": "RaptorDbCore.sln",
"chars": 2322,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.27130.2024\nM"
},
{
"path": "Tools/buildversion.ncs",
"chars": 1488,
"preview": "using System;\nusing System.IO;\nusing System.Windows.Forms;\nusing System.Text.RegularExpressions;\n\nnamespace pp\n{\n\tpublic"
},
{
"path": "Views/Class1.cs",
"chars": 5080,
"preview": "using System;\nusing System.Collections.Generic;\nusing RaptorDB;\n\n\nnamespace SampleViews\n{\n #region [ class definiti"
},
{
"path": "Views/Properties/AssemblyInfo.cs",
"chars": 1362,
"preview": "using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled "
},
{
"path": "Views/ServerSide.cs",
"chars": 1798,
"preview": "using System.Collections.Generic;\nusing System.Linq;\nusing RaptorDB.Common;\nusing SampleViews;\n\nnamespace Views\n{\n p"
},
{
"path": "Views/Views.csproj",
"chars": 2736,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microso"
},
{
"path": "WebStudio/README.md",
"chars": 333,
"preview": "# RaptorDB WebStudio\n\n\n## Get started\n\nInstall the dependencies...\n\n```bash\nnpm install\n```\n\n...then start [Rollup](http"
},
{
"path": "WebStudio/build.cmd",
"chars": 141,
"preview": "md dist\nmd public\ncopy src\\index.html public\\\ncopy src\\index.html dist\\\ncopy src\\global.css public\\\ncopy src\\global.css "
},
{
"path": "WebStudio/deploy.cmd",
"chars": 35,
"preview": "copy dist\\*.* ..\\raptordb\\web\npause"
},
{
"path": "WebStudio/package.json",
"chars": 626,
"preview": "{\n \"name\": \"RaptorDB-WebStudio\",\n \"version\": \"1.0.0\",\n \"devDependencies\": {\n \"npm-run-all\": \"^4.1.5\",\n \"rollup\""
},
{
"path": "WebStudio/rollup.config.js",
"chars": 1601,
"preview": "import svelte from 'rollup-plugin-svelte';\nimport resolve from 'rollup-plugin-node-resolve';\nimport commonjs from 'rollu"
},
{
"path": "WebStudio/src/App.svelte",
"chars": 7828,
"preview": "<script>\n import { tick, onMount } from \"svelte\";\n import NavPanel from \"./UI/nav.svelte\";\n import HelpPage from \"./p"
},
{
"path": "WebStudio/src/UI/Button.svelte",
"chars": 1607,
"preview": "<script>\n export let type = \"button\";\n export let href = null;\n export let mode = null;\n export let color = null;\n "
},
{
"path": "WebStudio/src/UI/Modal.svelte",
"chars": 1280,
"preview": "<script>\n import { createEventDispatcher } from \"svelte\";\n import { fly, fade } from \"svelte/transition\";\n import But"
},
{
"path": "WebStudio/src/UI/datatable.svelte",
"chars": 3448,
"preview": "<script>\n import { createEventDispatcher, tick } from \"svelte\";\n\n export let rows = [];\n export let totalrows = 1;\n "
},
{
"path": "WebStudio/src/UI/nav.svelte",
"chars": 2402,
"preview": "<script>\n import { createEventDispatcher } from \"svelte\";\n\n const dispatch = createEventDispatcher();\n\n let activepan"
},
{
"path": "WebStudio/src/debug.js",
"chars": 61,
"preview": "import './main.js'\nwindow.ServerURL = \"http://localhost:91/\";"
},
{
"path": "WebStudio/src/global.css",
"chars": 649,
"preview": "body {\n font-family: sans-serif;\n color: #222;\n background: #414141;\n}\n\n.tab-content {\n background-color: wh"
},
{
"path": "WebStudio/src/index.html",
"chars": 338,
"preview": "<html>\n<head>\n\t<meta charset='utf8'>\n\t<meta name='viewport' content='width=device-width'>\n\n\t<title>RaptorDB WebStudio</t"
},
{
"path": "WebStudio/src/main.js",
"chars": 2157,
"preview": "import App from './App.svelte';\n\nconst app = new App({\n target: document.body,\n});\n\nwindow.ServerURL = document.locat"
},
{
"path": "WebStudio/src/pages/dochistory.svelte",
"chars": 2173,
"preview": "<script>\n import { onMount } from \"svelte\";\n\n export let active = false;\n export let docid = null;\n let jsondata = \""
},
{
"path": "WebStudio/src/pages/docsearch.svelte",
"chars": 2765,
"preview": "<script>\n export let active = false;\n\n let find = \"\";\n let page = 1;\n let versions = [];\n let jsondata = \"\";\n let "
},
{
"path": "WebStudio/src/pages/docview.svelte",
"chars": 1431,
"preview": "<script>\n import { onMount, createEventDispatcher } from \"svelte\";\n export let active = false;\n export let docid = nu"
},
{
"path": "WebStudio/src/pages/help.svelte",
"chars": 395,
"preview": "<script>\n export let active = false;\n</script>\n\n<svelte:options accessors={true} />\n<!-- TODO : add more help descripti"
},
{
"path": "WebStudio/src/pages/hfbrowser.svelte",
"chars": 2831,
"preview": "<script>\n import { onMount, createEventDispatcher } from \"svelte\";\n export let active = false;\n const dispatch = crea"
},
{
"path": "WebStudio/src/pages/query.svelte",
"chars": 4713,
"preview": "<script>\n import { onMount, tick } from \"svelte\";\n import DataTable from \"../UI/datatable.svelte\";\n\n export let activ"
},
{
"path": "WebStudio/src/pages/schema.svelte",
"chars": 4960,
"preview": "<script>\n import { onMount } from \"svelte\";\n\n export let active = false;\n let viewname = \"\";\n let viewnames = [];\n\n "
},
{
"path": "WebStudio/src/pages/sysconfig.svelte",
"chars": 469,
"preview": "<script>\n import { onMount } from \"svelte\";\n export let active = false;\n\n let configs = \"\";\n\n // config\n onMount(()"
},
{
"path": "WebStudio/src/pages/sysinfo.svelte",
"chars": 2529,
"preview": "<script>\n import { onMount } from \"svelte\";\n\n export let active = false;\n let DataFolderSize = 0;\n let DocumentCount"
},
{
"path": "build.cmd",
"chars": 211,
"preview": "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\msbuild.exe\" /p:buildmode=Debug /t:rebui"
},
{
"path": "datagridbinding/Program.cs",
"chars": 762,
"preview": "using System;\nusing System.Windows.Forms;\nusing System.Reflection;\n\nnamespace datagridbinding\n{\n\n static class Progr"
},
{
"path": "datagridbinding/Properties/AssemblyInfo.cs",
"chars": 1382,
"preview": "using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled "
},
{
"path": "datagridbinding/datagridbinding.csproj",
"chars": 3480,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microso"
},
{
"path": "datagridbinding/frmMain.Designer.cs",
"chars": 13544,
"preview": "namespace datagridbinding\n{\n partial class frmMain\n {\n /// <summary>\n /// Required designer variabl"
},
{
"path": "datagridbinding/frmMain.cs",
"chars": 13827,
"preview": "using RaptorDB.Common;\nusing SampleViews;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Syst"
},
{
"path": "datagridbinding/frmMain.resx",
"chars": 6289,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "datagridbinding/frmStartup.Designer.cs",
"chars": 12587,
"preview": "namespace datagridbinding\n{\n partial class frmStartup\n {\n /// <summary>\n /// Required designer vari"
},
{
"path": "datagridbinding/frmStartup.cs",
"chars": 1498,
"preview": "using System;\nusing System.Windows.Forms;\nusing RaptorDB.Common;\nusing SampleViews;\n\nnamespace datagridbinding\n{\n pu"
},
{
"path": "datagridbinding/frmStartup.resx",
"chars": 5696,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "history.txt",
"chars": 18619,
"preview": "v4.0.10\n-------\n- upgrade to fastJSON v2.3.0\n- upgrade to fastBinaryJSON v1.6.0\n\nv4.0.9\n------\n- rewritten the web stud"
},
{
"path": "test script/run.cmd",
"chars": 30,
"preview": "..\\tools\\nscript.exe sample.cs"
},
{
"path": "test script/sample.cs",
"chars": 4337,
"preview": "// ref : ..\\output\\raptordb.dll\n// ref : ..\\output\\raptordb.common.dll\n// ref : ..\\faker.dll\nusing System;\nusing System."
},
{
"path": "testing/AssemblyInfo.cs",
"chars": 455,
"preview": "using System.Reflection;\nusing System.Security;\n\n[assembly: AssemblyTitle(\"\")]\n[assembly: AssemblyDescription(\"\")]\n[asse"
},
{
"path": "testing/Class1.cs",
"chars": 11967,
"preview": "using System;\nusing System.Diagnostics;\nusing System.Collections;\nusing System.IO;\nusing System.Text;\nusing System.Thre"
},
{
"path": "testing/program.cs",
"chars": 1172,
"preview": "using System;\nusing System.IO;\nusing RaptorDB;\n\nnamespace testing\n{\n public class program\n {\n static Raptor"
},
{
"path": "testing/tests.csproj",
"chars": 6332,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microso"
},
{
"path": "testing.view",
"chars": 947,
"preview": "// ref: views.dll\nusing System;\nusing System.Collections.Generic;\nusing RaptorDB;\n\nnamespace SampleViews\n{\n [Register"
},
{
"path": "vbTestConsole/App.config",
"chars": 180,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<configuration>\n <startup> \n <supportedRuntime version=\"v4.0\" sku=\".N"
},
{
"path": "vbTestConsole/Module1.vb",
"chars": 440,
"preview": "Module Module1\n\n Sub Main()\n Dim rdb As RaptorDB.RaptorDB = RaptorDB.RaptorDB.Open(\"..\\..\\..\\RaptorDBdata\")\n "
},
{
"path": "vbTestConsole/My Project/Application.Designer.vb",
"chars": 426,
"preview": "'------------------------------------------------------------------------------\n' <auto-generated>\n' This code was "
},
{
"path": "vbTestConsole/My Project/Application.myapp",
"chars": 469,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<MyApplicationData xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:x"
},
{
"path": "vbTestConsole/My Project/AssemblyInfo.vb",
"chars": 1153,
"preview": "Imports System\nImports System.Reflection\nImports System.Runtime.InteropServices\n\n' General Information about an assembl"
},
{
"path": "vbTestConsole/My Project/Resources.Designer.vb",
"chars": 2726,
"preview": "'------------------------------------------------------------------------------\n' <auto-generated>\n' This code was "
},
{
"path": "vbTestConsole/My Project/Resources.resx",
"chars": 5494,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "vbTestConsole/My Project/Settings.Designer.vb",
"chars": 2942,
"preview": "'------------------------------------------------------------------------------\n' <auto-generated>\n' This code was "
},
{
"path": "vbTestConsole/My Project/Settings.settings",
"chars": 270,
"preview": "<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\""
},
{
"path": "vbTestConsole/vbtestconsole.vbproj",
"chars": 5319,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
}
]
// ... and 2 more files (download for full content)
About this extraction
This page contains the full source code of the mgholam/RaptorDB-Document GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 150 files (1.2 MB), approximately 280.7k tokens, and a symbol index with 1888 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.