キースペースに複数の列ファミリーを作成する必要があります。1つの方法は、列ファミリーを1つずつ作成することです..しかし、私の場合、約100個の列ファミリーがあるため、1つずつ行うことはできません...だから、何らかの方法で複数の列ファミリーを作成する方法はありますか1 回の短い操作で複数の列ファミリーを作成できるスクリプトはありますか?
create column family USER_DATA_SECOND_1
with comparator = 'UTF8Type'
and key_validation_class = 'CompositeType(DateType,UTF8Type)'
and default_validation_class = 'BytesType'
and gc_grace = 86400
create column family USER_DATA_SECOND_2
with comparator = 'UTF8Type'
and key_validation_class = 'CompositeType(DateType,UTF8Type)'
and default_validation_class = 'BytesType'
and gc_grace = 86400
create column family USER_DATA_SECOND_3
with comparator = 'UTF8Type'
and key_validation_class = 'CompositeType(DateType,UTF8Type)'
and default_validation_class = 'BytesType'
and gc_grace = 86400
....
....
....
create column family USER_DATA_SECOND_100
with comparator = 'UTF8Type'
and key_validation_class = 'CompositeType(DateType,UTF8Type)'
and default_validation_class = 'BytesType'
and gc_grace = 86400
また、これらの複数の列ファミリーを作成した後..これらすべての列ファミリーを再度削除する必要がある場合、スクリプトを使用してそれを行う方法を考えてみてください。
以下は、ローカル マシンからステージング カサンドラ サーバーに列ファミリーを 1 つずつ作成する方法ですが、これは私が望んでいるものではありません。
C:\Apache Cassandra\apache-cassandra-1.2.3\bin>cassandra-cli -h sc-cdbhost01.vip.slc.qa.host.com
Starting Cassandra Client
Connected to: "Staging Cluster cass01" on sc-cdbhost01.vip.slc.qa.host.com/9160
Welcome to Cassandra CLI version 1.2.3
Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.
[default@unknown] use profileks;
Authenticated to keyspace: profileks
[default@profileks] create column family USER_DATA_SECOND_1
... with comparator = 'UTF8Type'
... and key_validation_class = 'CompositeType(DateType,UTF8Type)'
... and default_validation_class = 'BytesType'
... and gc_grace = 86400;
27fe1848-c7de-3994-9289-486a9bbbf344
[default@profileks]
ある種のスクリプトを使用して複数の列ファミリーを作成し、それらの列ファミリーを何らかのスクリプトを使用してドロップすることが可能かどうか、誰でも助けてもらえますか?