public ByteKeyIterator(Table table, ByteRangeParams ps) { this.table = table; this.startKey = ps.startKey; this.endKey = ps.endKey; this.prefix = ps.prefix; this.count = ps.count; this.granularity = ps.granularity; this.forwardDirection = ps.forwardDirection; Query(false); }
internal ulong Count(ulong tableID, ByteRangeParams ps) { int status; unsafe { fixed(byte *pStartKey = ps.startKey, pEndKey = ps.endKey, pPrefix = ps.prefix) { IntPtr ipStartKey = new IntPtr(pStartKey); IntPtr ipEndKey = new IntPtr(pEndKey); IntPtr ipPrefix = new IntPtr(pPrefix); status = scaliendb_client.SDBP_CountCStr(cptr, tableID, ipStartKey, ps.startKey.Length, ipEndKey, ps.endKey.Length, ipPrefix, ps.prefix.Length, ps.forwardDirection); } } CheckResultStatus(status); ulong number = result.GetNumber(); result.Close(); return(number); }
/// <summary> /// Return an iterator that will return keys and values as a <see cref="System.Collections.Generic.KeyValuePair{T, T}"/>. /// </summary> /// <param name="ps">The parameters of iteration, as a <see cref="Scalien.ByteRangeParams"/>.</param> /// <returns>The iterator.</returns> /// <seealso cref="System.Collections.Generic.KeyValuePair{T, T}"/> /// <seealso cref="Scalien.ByteRangeParams"/> /// <seealso cref="GetKeyValueIterator(StringRangeParams)"/> /// <seealso cref="GetKeyIterator(StringRangeParams)"/> /// <seealso cref="GetKeyIterator(ByteRangeParams)"/> public virtual ByteKeyValueIterator GetKeyValueIterator(ByteRangeParams ps) { return(new ByteKeyValueIterator(this, ps)); }
/// <summary> /// Return the number of matching keys in the table. /// </summary> /// <param name="ps">The filter parameters.</param> /// <returns>The number of matching keys in the table.</returns> /// <exception cref="SDBPException"/> /// <seealso cref="Scalien.ByteRangeParams"/> /// <seealso cref="Count(StringRangeParams)"/> public virtual ulong Count(ByteRangeParams ps) { return(client.Count(tableID, ps)); }
/// <summary> /// Return an iterator that will return keys and values as a <see cref="System.Collections.Generic.KeyValuePair{T, T}"/>. /// </summary> /// <param name="ps">The parameters of iteration, as a <see cref="Scalien.ByteRangeParams"/>.</param> /// <returns>The iterator.</returns> /// <seealso cref="System.Collections.Generic.KeyValuePair{T, T}"/> /// <seealso cref="Scalien.ByteRangeParams"/> /// <seealso cref="GetKeyValueIterator(StringRangeParams)"/> /// <seealso cref="GetKeyIterator(StringRangeParams)"/> /// <seealso cref="GetKeyIterator(ByteRangeParams)"/> public ByteKeyValueIterator GetKeyValueIterator(ByteRangeParams ps) { return new ByteKeyValueIterator(this, ps); }
/// <summary> /// Return the number of matching keys in the table. /// </summary> /// <param name="ps">The filter parameters.</param> /// <returns>The number of matching keys in the table.</returns> /// <exception cref="SDBPException"/> /// <seealso cref="Scalien.ByteRangeParams"/> /// <seealso cref="Count(StringRangeParams)"/> public ulong Count(ByteRangeParams ps) { return client.Count(tableID, ps); }
public void ListTestLinq() { Client client = new Client(Utils.GetConfigNodes()); Table table = client.GetDatabase("Benchmark").GetTable("transactionNetworkTransaction"); byte[] prefix = Utils.StringToByteArray("N:0000000000000|T:000000"); byte[] startKey = Utils.StringToByteArray("N:0000000000000|T:0000001250847|"); var rangeParams = new ByteRangeParams().StartKey(startKey).Prefix(prefix); ByteKeyValueIterator iterator = table.GetKeyValueIterator(rangeParams); var list = new List<KeyValuePair<byte[], byte[]>>(); list.AddRange(iterator.Select(kv => kv)); }
/// <summary> /// Return an iterator that will return only keys. /// </summary> /// <param name="ps">The parameters of iteration, as a <see cref="Scalien.ByteRangeParams"/>.</param> /// <returns>The iterator.</returns> /// <seealso cref="Scalien.ByteRangeParams"/> /// <seealso cref="GetKeyIterator(ByteRangeParams)"/> /// <seealso cref="GetKeyValueIterator(StringRangeParams)"/> /// <seealso cref="GetKeyValueIterator(ByteRangeParams)"/> public virtual ByteKeyIterator GetKeyIterator(ByteRangeParams ps) { return new ByteKeyIterator(this, ps); }