0

thrift インターフェイスを使用して Cassandra 0.6.5 を使用しています。batch_mutate メソッド呼び出しを使用しようとしていますが、実行してもエラー メッセージが表示されません。これは、それが機能したと私に信じさせます。CLIで確認すると何もありません。私のコードや、誰もが見ることができる Mutation_map の形式に何か問題がありますか? 何か案は?

前もって感謝します、

LN

public void Update(string keyspace, Common.NetworkPackage.MetaAsset ma)
{
  Dictionary<string, Dictionary<string, List<Mutation>>> package;
  Dictionary<string, List<Mutation>> packageEntry;
  Dictionary<string, object>.Enumerator en;
  List<Mutation> mutList;
  Mutation mut;
  DateTime now = DateTime.Now;

  if(!ma.Fields.ContainsKey("$guid")) 
    throw new ArgumentException("The field $guid is not present");

  mutList = new List<Mutation>();
  en = ma.Fields.GetEnumerator();

  while(en.MoveNext())
  {
    if (en.Current.Value == null)
      continue;
    mut = new Mutation();
    mut.Column_or_supercolumn = new ColumnOrSuperColumn();
    mut.Column_or_supercolumn.Column = new Column();
    mut.Column_or_supercolumn.Column.Name = _utf8.GetBytes(en.Current.Key);

    if (en.Current.Value == null)
      mut.Column_or_supercolumn.Column.Value = null;
    else
      mut.Column_or_supercolumn.Column.Value = ToBytes(en.Current.Value);

    mut.Column_or_supercolumn.Column.Timestamp = Utilities.Timestamp(now);          
    mutList.Add(mut);
  }

  packageEntry = new Dictionary<string, List<Mutation>>();
  packageEntry.Add("MetaAsset", mutList);

  package = new Dictionary<string, Dictionary<string, List<Mutation>>>();
  package.Add((string)ma.Fields["$guid"], packageEntry);

  Console.WriteLine(Utilities.ExportBulkMutate("LawOffice", package));

  _client.batch_mutate(keyspace, package, ConsistencyLevel.QUORUM);
}

上記のコードは生成します (列は名前:値 @ タイムスタンプで、値は型: と実際の値の表現で構成されます):

LawOffice : {
 Row=08469fba50f448be8943614abd059d10 : {
   CF=MetaAsset : {
    $guid : String:08469fba50f448be8943614abd059d10 @ 93
    $creator : String:Lucas @ 93
    $previousversion : String:00000000000000000000000000000000 @ 93
    $nextversion : String:00000000000000000000000000000000 @ 93
    $etag : String:0 @ 93
    $length : Int32:123456789 @ 93
    $extension : String:.odt @ 93
    $created : DateTime:90 @ 93
    $modified : DateTime:90 @ 93
    $lastaccess : DateTime:90 @ 93
    $title : String:Title @ 93
    $tags : List`1:tag1,tag2,tag3 @ 93
   }
 }
}
4

1 に答える 1

1

これはバグとしてマークされており、https://issues.apache.org/jira/browse/CASSANDRA-1482で追跡できます。

于 2010-09-09T00:26:53.000 に答える