本文整理汇总了C#中Aerospike.Client.AerospikeClient.Join方法的典型用法代码示例。如果您正苦于以下问题:C# AerospikeClient.Join方法的具体用法?C# AerospikeClient.Join怎么用?C# AerospikeClient.Join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aerospike.Client.AerospikeClient
的用法示例。
在下文中一共展示了AerospikeClient.Join方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public void Read(AerospikeClient client, BatchPolicy policy, string ns, string set, string accountId)
{
Record record = client.Join(policy,
new Key(ns, set, accountId),
new Join("tickers", ns, set));
if (record == null)
{
throw new Exception("Failed to read: " + accountId);
}
this.accountId = accountId;
byte[] positionsBytes = (byte[])record.GetValue("positions");
Record[] records = (Record[])record.GetValue("tickers");
if (positionsBytes != null)
{
MemoryStream ms = new MemoryStream(positionsBytes);
BinaryReader reader = new BinaryReader(ms);
int count = reader.ReadInt32();
positions = new List<Position>(count);
for (int i = 0; i < count; i++)
{
positions.Add(new Position(reader, records[i]));
}
}
else
{
positions = new List<Position>(0);
}
}