GridDB APIリファレンス

Table of Contents

1 はじめに

このマニュアルでは、分散大容量DB、GridDBプログラミングに必要となる、APIやクエリ言語の使用方法を説明します。

GridDBにおける管理操作や基本的なデータ取り出しには、JavaまたはC言語によるAPIを使用します。より複雑な条件を記述する場合は、専用のクエリ言語TQLを使用します。

2 概要

2.1 用語

主な用語を説明します。

  • ノード
    • GridDBでデータ管理を行う個々のサーバプロセスを指します。
  • ロウ
    • GridDBで管理する1件分のデータを指します。1つ以上の値を持つひとまとまりのデータです。
  • コンテナ
    • ロウの集合を管理する入れ物です。コレクションと時系列の2種類が存在します。
    • ロウはカラムごとに1つのフィールドを持ちます。それぞれのフィールドは常に1つの値を持ちます。フィールドの値としてNULLを設定することはできません。
    • コンテナ名ならびにカラム名は、1文字以上のASCII英数字ならびにアンダースコア「_」の列で構成されます。ただし、先頭の文字には数字を指定できません。また、大文字・小文字は区別されません。
  • コレクション
    • ロウを管理するコンテナの一種です。ロウに対しキーを持たせることも、持たせないこともできます。キーとして使用できる型は単一の文字列(STRING)型、INTEGER型、LONG型、または時刻(TIMESTAMP)型です。
  • 時系列
    • 時刻(TIMESTAMP)型のキーを持つロウを管理するコンテナの一種です。時系列データを扱う専用の機能を持ちます。キーが時系列ロウの時刻に相当します。

2.2

フィールドならびにクエリ演算で用いる値の制約を示す、型について定義します。

2.2.1 基本型

他の型の組み合わせで表現できない、基本的な型を定義します。

  • ブール(BOOL)型
    真または偽のいずれかの値を表します。
  • 文字列(STRING)型
    Unicodeコードポイントを文字とする、任意個数の文字の列より構成されます。ただし、NULL文字(U+0000)は扱いません。上限サイズについてはシステムの制限値を参照してください。
  • 整数型
    それぞれ次の範囲の整数値を表します。
    • BYTE型: -27から27-1 (8ビット)
    • SHORT型: -215から215-1 (16ビット)
    • INTEGER型: -231から231-1 (32ビット)
    • LONG型: -263から263-1 (64ビット)
  • 浮動小数点数型
    IEEE754で定められた浮動小数点数を表します。精度に応じた次の型があります。
    • FLOAT型: 単精度型(32ビット)
    • DOUBLE型: 倍精度型(64ビット)

    ※演算精度は原則IEEE754準拠ですが、実行環境により異なる場合があります。

  • 時刻(TIMESTAMP)型
    年月日ならびに時分秒からなる時刻を表します。表現範囲については付録の値の範囲を参照してください。
  • BLOB型
    画像や音声などのバイナリデータを表します。上限サイズについてはシステムの制限値を参照してください。

2.2.2 複合型

基本型の組み合わせで構成される型を定義します。

  • 配列型

    値の列を表します。以下の型について配列型を提供します。長さとは、構成される配列要素の数であり、最小値は0となります。長さの上限についてはシステムの制限値を参照してください。

    • ブール型
    • 文字列型
    • 整数型
    • 浮動小数点数型
    • 時刻型

3 TQL構文・演算機能

TQLでは、データの取り出し・削除・更新対象の選択のために必要となる、SQLのselect文相当のクエリをサポートします。選択したデータの操作、データ構造管理やトランザクション処理といった、選択操作以外の構文は扱いません。

3.1 基本構文

すべてのクエリは、次の構文により表現されます。

[EXPLAIN [ANALYZE]] SELECT (選択式) [FROM (コレクション・時系列名)] [WHERE (条件式)] [ORDER BY (ソート条件)] [LIMIT (数値) [OFFSET (数値)]]

SELECT構文は、FROM節で指定したコレクション・時系列の各ロウについて、WHERE節の条件式に従い絞り込み、その結果を対象カラムや集計方法などが指定された選択式に基づき加工することを要求します。

クエリ実行対象のコレクション・時系列がすでに確定している場合、FROM節を省略するか、対象と同じ名前をFROM節に指定する必要があります。ただし、大文字・小文字は区別されません。WHERE節を省略した場合、対象コレクション・時系列のすべてのロウが選択されます。

SELECT文の前にEXPLAINまたはEXPLAIN ANALYZEを付けた場合、SELECT文に対する実行プラン情報ならびに実行結果の解析情報を求めます。詳細は後述の節を参照してください。

なお、集計演算などを除き、SQLのように特定カラムだけを取り出すことはできません。また、次に相当する節は記述できません。

  • GROUP BY
  • HAVING
  • DISTINCT
  • FOR UPDATE※APIにて指定可能
  • JOIN

これらの基本構文のキーワード、ならびに以降の節で定義する関数や演算子・列挙定数名については、ASCIIコードでの大文字部分を小文字のみで表記することもできます。

3.2 条件式構文・演算機能

WHERE節で使用される条件式の構文、ならびに、条件式で利用可能な演算子や関数を定義します。

3.2.1

値は、クエリ内で一定のリテラル、または、評価中のロウにおける指定カラムのフィールドのいずれかにより表現します。

  • リテラル値
    次のいずれかのリテラル値を指定します。
    • 数値型: 10進数による文字列表現で記述します。浮動小数点数の表記はIEEE754に従います。なお、DOUBLE型の非数、正の無限大、負の無限大は、それぞれNAN、INF、-INFと表記します
    • 文字列: シングルクォーテーションで囲んだ文字列を指定します。文字列を構成する文字の一つとしてシングルクォーテーションを表記するためには、シングルクォーテーションを二つ続けて記述します。それ以外の用途でシングルクォーテーションを記述することはできません
  • フィールド値
    評価中のロウが持つフィールド値を指定するには、対応するカラム名をそのまま記述するか、引用符「"」で囲んだカラム名を記述します。引用符で囲むことにより、「SELECT」や「WHERE」といったキーワードと同名のカラムについても扱うことができます。カラム名についての大文字・小文字表記の違いは区別されません。また、「.」などを用いてコレクション・時系列の名前と組み合わせることはできません。

3.2.2 演算子の優先順位

演算子は、次の優先順で評価されます。同順序の演算子同士の場合、記述した順序通りに評価されます。

  1. -(単項)
  2. *, /, %
  3. -(二項), +
  4. =, >=, >, <=, <, <>, LIKE
  5. NOT
  6. AND
  7. OR, XOR

なお、式を「(」…「)」で囲むことで、上の演算子よりも優先して該当する式を評価します。

3.2.3 比較演算

  • 型の制約
    両辺の型の組み合わせは、ブール型同士、文字型同士、数値型同士、時刻型同士のいずれかのみです。数値型については、両辺の精度が異なる場合、より表現範囲の大きい型、もしくはより精度の高い型に変換されます。なお、ブール型同士、文字列型同士の場合、大小比較はできません。
  • =, >=, >, <=, <, <>
    それぞれ、等価、以上、大なり、以下、小なり、非等価の比較演算結果をブール型で求めます。 浮動小数点数の比較結果は基本的にはIEEE754に従いますが、NAN(非数)は他の全ての値より大きいと見なし、 NAN同士は等しいと評価します。

3.2.4 論理演算

  • NOT, AND, OR, XOR
    それぞれ、否定、論理積、論理和、排他的論理和を示します。演算対象はブール型でなければなりません。 また、AND, ORの演算では短絡評価(または最小評価)を行います。すなわち、先に記述されている式で評価を確定できる場合、後に記述されている式の評価を行いません。 たとえば、
    WHERE A=1 AND B=1
    

    の場合、Aが1であれば、B=1を評価しますが、Aが1でない場合、B=1の評価は行いません。

3.2.5 文字列演算

  • CHAR_LENGTH(str)
    文字列の長さを求めます。
  • CONCAT(str1, str2, …)
    指定の文字列を順に結合し、1つの文字列を生成します。
  • str LIKE pattern [ESCAPE esc]
    検査対象の文字列全体が指定のパターンと一致するかどうかを判定します。判定の際、大文字・小文字を区別します。判定により一致した場合のみ真を返します。

    パターン指定では、次のワイルドカード文字を使用できます。

    • %: 0文字以上の任意の文字列と一致
    • _: 1文字の任意の文字と一致

    たとえば、次の式は「山田」「田中」「山田太郎」に対して真を返しますが、「小山田」に対しては偽を返します。

    column LIKE '_田%'
    

    ワイルドカード文字は、パターン内の任意の位置に任意の回数だけ使用できます。 空文字列のパターンを指定した場合、常に偽を返します。

    ワイルドカード文字そのものを検索する場合には、ESCAPE節を使ってエスケープ文字を指定します。 たとえば、以下の式は「10%」に対しては真を返しますが、「10$%」に対しては偽を返します。

    column LIKE '10$%' ESCAPE '$'
    

    エスケープ文字の長さは常に1でなければなりません。

    検査対象の文字列、パターン、エスケープには、カラム名もしくは文字列リテラルのみを指定できます。

  • SUBSTRING(str, start[, length])
    部分文字列を求めます。

    startには1から始まる文字位置、lengthには取り出す文字列の長さを示す0以上の値を指定します。lengthを省略した場合、指定start位置以降のすべての文字を含めます。start、lengthが範囲外の値を指す場合、空文字列を返します。ただし、startに0以下の値、lengthに0未満の値を指定することはできません。

  • UPPER(str), LOWER(str)
    文字列中のASCII相当の英字について、それぞれ大文字または小文字に変換します。

3.2.6 数値演算

  • +, -(単項), -(二項), *, /, %
    算術演算を行います。それぞれ、加算、符号反転、減算、乗算、除算、剰余算を表します。ただし浮動小数点数に対する剰余算は行えません。 浮動小数点数において被除数が0以外の数で除数が0の場合は無限大、被除数と除数が共に0の場合は非数になります。 無限大や非数に関する演算はIEEE754に従います。
  • ROUND(num)、FLOOR(num)、CEILING(num)
    それぞれ、元の浮動小数点数に関して、小数の桁を四捨五入した整数値、より小きな整数値のうち最大のもの、より大きな整数値のうち最小のものを求めます。結果はDOUBLE型となります。 丸めの方向はそれぞれ、0から遠い方、負の無限大に近い方、正の無限大に近い方になります。 したがってnumが負の値の場合の計算結果は、numの絶対値abs(num)を用いると、-ROUND(abs(num))、-CEILING(abs(num))、-FLOOR(abs(num))と等しくなります。

    それぞれの計算例は以下の通りです。

    ROUNDFLOORCEILING
    1.341.01.02.0
    3.674.03.04.0
    -0.230.0-1.0-0.0
    -3.89-4.0-4.0-3.0

    なお、+0.0、-0.0、整数、非数(NAN)、正負の無限大(INF、-INF)に対してこれらの操作を行っても値は変化しません。

3.2.7 時刻型演算

  • NOW()
    現在時刻を返します。同一のクエリ実行単位内では、常に同一の結果を返します。
  • TIMESTAMP(str)
    時刻の文字列表現を時刻型に変換します。

    文字列表現として、西暦、UTCでの次の形式のみをサポートします。

    YYYY-MM-DDThh:mm:ss.SSSZ
    

    「.SSS」の部分は省略できます。 上の形式のうち、英字の部分は10進数表現の整数値で、それぞれ次の意味を示します。

    • YYYY: 年に相当する。最低4桁
    • MM: 月に相当する。常に2桁であり、1から12の範囲で指定する
    • DD: 日に相当する。常に2桁であり、1から31の範囲で指定する。存在しない日を指定した場合、受け付けない。年や月によって異なる
    • hh: 24時間表記での時間に相当する。常に2桁であり、0から23の範囲で指定する
    • mm: 分に相当する。常に2桁であり、0から59の範囲で指定する
    • ss: 秒に相当する。常に2桁であり、0から59の範囲で指定する
    • SSS: ミリ秒に相当する。常に3桁であり、0から999の範囲で指定する

    表現範囲については付録の値の範囲を参照してください。

  • TIMESTAMPADD(YEAR|MONTH|DAY|HOUR|MINUTE|SECOND|MILLISECOND, timestamp, duration)
    指定の時刻に対し、指定した単位の特定の期間を加算します。期間には数値型の値を指定します。負の値の期間を指定した場合は、元の時刻より過去の時刻が求まります。現バージョンでは、算出の際に使用されるタイムゾーンはUTCです。
  • TIMESTAMPDIFF(YEAR|MONTH|DAY|HOUR|MINUTE|SECOND|MILLISECOND, timestamp1, timestamp2)
    2つの時刻の差について、指定した単位で結果を求めます。結果は数値型の値となります。現バージョンでは、算出の際に使用されるタイムゾーンはUTCです。

    例) チケット一覧(tickets)の中から、有効期間が3日以上のチケットを選択する

    SELECT * FROM tickets WHERE TIMESTAMPDIFF(DAY, expired, issued) >= 3
    
  • TO_TIMESTAMP_MS(num)
    時刻1970-01-01T00:00:00Zのnumミリ秒後に対応するTIMESTAMPへ変換します。numが浮動小数点数型の値の場合、エラーになります。また、負の値や極端に大きな値など、変換結果が時刻型で表せない場合はエラーになります。そのため、数値型カラムに対して本関数を用いたクエリを発行した場合、カラムの値に変換結果が時刻型で表せない値が含まれているとエラーになります。例えば、以下のクエリはnum=-1となるロウがコンテナ内にある場合エラーになります。
    SELECT * WHERE TO_TIMESTAMP_MS(num) > TIMESTAMP('2011-01-01T00:00:00Z')
    

    このような場合はTO_EPOCH_MS関数を用いて以下のようにして、数値型の値を変換した結果が時刻型の範囲となる値だけを評価するようにして回避してください。

    SELECT * WHERE num < TO_EPOCH_MS(TIMESTAMP('9999-12-31T23:59:59.999Z')) AND num >= 0 AND TO_TIMESTAMP_MS(num) > TIMESTAMP('2011-01-01T00:00:00Z')
    
  • TO_EPOCH_MS(timestamp)
    timestampで指定した時刻型の値について、時刻1970-01-01T00:00:00Zからのミリ秒単位での経過時間を示すLONG型の値へ変換します。時刻型でない値が指定された場合はエラーになります。この関数はTO_TIMESTAMP_MS関数の逆変換です。

3.2.8 配列型演算

  • ARRAY_LENGTH(array)
    配列の長さを求めます。
  • ELEMENT(n, array)
    特定位置の配列要素を取り出します。長さ1以上の配列でなければなりません。 nには0から始まる要素位置を整数で指定します。 nが浮動小数点数や負の値の場合、nがarrayの長さより長い場合、またarrayの長さが0の場合はエラーになります。 そのため、コレクションに長さが異なる配列が格納されている場合、 以下のような配列要素を指定したクエリは配列要素が取得できない場合にエラーになる可能性があります。
    SELECT * FROM arrays WHERE ELEMENT(1, array) = 1
    

    このようなクエリは以下のようにしてELEMENT関数が評価されるのを回避してください。

    SELECT * FROM arrays WHERE ARRAY_LENGTH(array)>= 1 AND ELEMENT(1, array) = 1
    

3.3 選択式

3.3.1 基本構文

対象カラムや集計方法などを記述する、選択式の構文を定義します。処理対象となるロウは、FROM節、WHERE節の条件に合致したものに限定されます。

  • *(アスタリスク)
    条件に合致したすべてのロウをそのまま選択します。ORDER BY節(後述)を指定することでカラムの値によって並べ替えることができます。
  • (演算関数)
    後述の演算関数のうちいずれか1つの関数により、集計・選択などの演算を行います。

    演算の内部処理にてオーバーフローが発生した場合、浮動小数点数型では負または正の無限大、整数型では未定義の値が求まります。また、浮動小数点数型にて演算対象に非数(NAN)が含まれていた場合、非数が求まります。

3.3.2 集計演算 ― 一般

任意のロウ集合に対して、集計演算を行います。

集計対象となるロウが1つも存在しない場合、COUNT関数を除き結果件数は0件となります。それ以外の場合、結果件数は1件となります。

  • MAX(column)
    指定カラムの値の最大値を求めます。数値型または時刻型のカラムのみ指定できます。演算結果の型は、指定カラムと同一の型となります。
  • MIN(column)
    指定カラムの値の最小値を求めます。数値型または時刻型のカラムのみ指定できます。演算結果の型は、指定カラムと同一の型となります。
  • COUNT(*)
    集計対象のロウの個数を求めます。カラムは指定できません。演算結果の型は常にLONGとなります。対象となるロウが1つも存在しない場合、演算結果の値は0となります。
  • SUM(column)
    指定のカラムの値の合計値を求めます。数値型のカラムのみ指定できます。演算結果の型は、対象のカラムが整数型の場合LONG、浮動小数点型の場合DOUBLEとなります。
  • AVG(column)
    指定のカラムの値の平均を求めます。数値型のカラムのみ指定できます。演算結果の型は常にDOUBLEとなります。
  • VARIANCE(column)
    指定のカラムの値の分散値を求めます。数値型のカラムのみ指定できます。演算結果の型は常にDOUBLEとなります。
  • STDDEV(column)
    指定のカラムの値の標準偏差を求めます。数値型のカラムのみ指定できます。演算結果の型は常にDOUBLEとなります。

3.3.3 集計演算 ― 時系列

時系列のロウ集合に対して、集計演算を行います。

ロウの時刻に基づき重み付けを行う集計演算では、条件に合致した各ロウについて、前後それぞれの時刻のロウとの中間時刻間の期間を特定の単位で換算したものを、重み付け値として使用します。ただし、前後いずれかの時刻のロウのみが存在しない場合は、存在しないロウの代わりに重み付け対象のロウを用いて求めた重み付け値を使用します。前後いずれの時刻のロウも存在しない場合は、重み付け値として1(単位は前後いずれかのロウが存在する場合と同一)を使用します。

  • TIME_AVG(column)
    指定のカラムの値について、ロウの時刻に基づく重み付き平均を求めます。演算結果の型は常にDOUBLEとなります。

    各標本値と重み付け値との積の合計を、各重み付け値の合計で割ることにより求めます。数値型のカラムのみ指定できます。重み付け値の計算方法は、前節の通りです。

    例) プラント1、ポイント103における、2011年7月の平均電圧について、時刻による重み付きで求める

    SELECT TIME_AVG(voltage103) FROM plant1
      WHERE TIMESTAMP('2011-07-01T00:00:00Z') <= timestamp AND timestamp < TIMESTAMP('2011-08-01T00:00:00Z')
    

    ここで、次のような時系列の場合の、重み付き平均値の計算手順の一例を紹介します。

    キー(2011年7月1日0時0分の秒の位)集計対象カラム
    0秒4
    10秒3
    20秒2
    40秒1

    この時系列を次の表のように拡張し、左の列から順に、前後時刻のロウとの中間時刻、重み付け値、標本値(カラムの値)と重みとの積を順に求めます。

    キー集計対象カラム中間時刻(秒の位)中間時刻(前)との差中間時刻(後)との差重み付け値標本値と重みとの積
    0秒4--5 (=5-0)520 (=4*5)
    (中間)-5秒(=(0+10)/2)----
    10秒3-5 (=10-5)5 (=15-10)10 (=5+5)30 (=3*10)
    (中間)-15秒(=(10+20)/2)----
    20秒2-5 (=20-15)10 (=30-20)15 (=5+10)30 (=2*15)
    (中間)-30秒(=(20+40)/2)----
    40秒1-10 (=40-30)-1010 (=1*10)

    最後に、標本値と重みとの積、重み付け値をそれぞれ合計し、商を求めます。この時系列の場合、(20+30+30+10)/(5+10+15+10)=90/40=2.25となります。以上の手順は、必ずしもGridDB内部の演算手順と同一であるとは限りません。

    なお、通常の重みなし平均値の場合、(4+3+2+1)/4=10/4=2.5となります。

3.3.4 時系列データ選択・補間演算

  • TIME_NEXT(*, timestamp)
    指定の時刻と同一またはその直後の時刻を持つ1つの時系列ロウを選択します。

    例) プラント1における、2011年7月初めの時点の温度を求める

    SELECT TIME_NEXT(*, TIMESTAMP('2011-07-01T00:00:00Z')) FROM plant1
    
  • TIME_NEXT_ONLY(*, timestamp)
    指定の時刻の直後の時刻を持つ1つの時系列ロウを選択します。
  • TIME_PREV(*, timestamp)
    指定の時刻と同一またはその直前の時刻を持つ1つの時系列ロウを選択します。
  • TIME_PREV_ONLY(*, timestamp)
    指定の時刻の直前の時刻を持つ1つの時系列ロウを選択します。
  • TIME_INTERPOLATED(column, timestamp)
    指定の時刻に関して、一致する時系列ロウの指定のカラムの値、もしくは、前後時刻のロウの指定カラムの値を線形補間して得られた値を求めます。前後時刻のロウの少なくともいずれか、もしくは、一致するロウが存在しない場合、目的のロウは生成されず、結果件数は0件となります。数値型のカラムのみ指定できます。指定のカラムならびにキー以外のフィールドには、指定時刻と同一またはより前の時刻のロウのうち、最も新しい時刻を持つロウのフィールドの値が設定されます。
  • TIME_SAMPLING(*|column, timestamp_start, timestamp_end, interval, DAY|HOUR|MINUTE|SECOND|MILLISECOND)
    開始・終了時刻を指定して、特定範囲のロウ集合をサンプリングします。

    サンプリング位置の時刻は、開始時刻に対し非負整数倍のサンプリング間隔を加えた時刻のうち、終了時刻と同じかそれ以前のもののみです。

    各サンプリング位置の時刻と一致するロウが存在する場合は該当ロウの値を使用します。存在しない場合は補間された値を使用します。補間対象のロウフィールドのうち指定のカラムのものは、サンプリング時刻の前後時刻のロウの値より線形補間して求めた値を使用します。それ以外のフィールドには、対象地点の時刻より前の時刻のロウのうち、最も新しい時刻を持つロウの値を補間値として使用します。線形補間対象のカラムの型は、すべて数値型でなければなりません。カラムを具体的に指定せず、「*」を指定した場合、すべてのフィールドについて後者の補間方法により値を求めます。

    補間のために参照する必要のあるロウが存在しない場合、該当するサンプリング時刻のロウは生成されず、該当箇所の数だけ結果件数が減少します。サンプリング間隔をより短く設定すると、線形補間対象外のカラムについては、異なるサンプリング時刻であっても同一のロウの内容が使用される可能性が高まります。サンプリング間隔に対応する引数intervalには正の値のみ指定できます。

    例) プラント1、ポイント103における、2011年7月1日の毎時ごとの電圧を求める

    SELECT TIME_SAMPLING(
      voltage103, TIMESTAMP('2011-07-01T00:00:00Z'), TIMESTAMP('2011-07-02T00:00:00Z'), 1, HOUR) FROM plant1
    

    また、このサンプリング結果についてORDER BY節(後述)を記述してカラム順に並べ替えることができます。 例) プラント1、ポイント103における、2011年7月1日の毎時ごとの電圧を求め、電圧順に並び替える

    SELECT TIME_SAMPLING(
      voltage103, TIMESTAMP('2011-07-01T00:00:00Z'), TIMESTAMP('2011-07-02T00:00:00Z'), 1, HOUR) FROM plant1 ORDER BY voltage103
    

3.3.5 最大値・最小値のロウ集合選択演算

任意のロウ集合に対して、指定カラムの値で最大値もしくは最小値をもつロウ集合を返します。

  • MAX_ROWS(column)
    指定カラムの値で最大値をもつロウ集合を求めます。数値型または時刻型のカラムのみ指定できます。
  • MIN_ROWS(column)
    指定カラムの値で最小値をもつロウ集合を求めます。数値型または時刻型のカラムのみ指定できます。

3.4 検索結果の並び替え(ORDER BY)

ORDER BY節を記述することで、検索結果の並び替えの順序を指定することができます。 ORDER BY節の記述は以下のように定義されます。

ORDER BY (カラム名) [ASC|DESC] [, (カラム名) [ASC|DESC]]*

ただし'*'は前要素の0回以上の繰り返しとします。

ASCは昇順指定を表しており、DESCは降順指定を表します。指定を省略すると昇順を指定したものとみなします。 複数ソート条件が記述された場合、先頭の条件から順に優先されます。

例) aの降順を第一ソート条件、bの昇順を第二ソート条件, cの昇順を第三ソート条件として検索する

SELECT * ORDER BY a DESC, b ASC, c

SQLとは異なり、ソート条件に計算式や関数を指定することはできません。

3.5 検索結果の取得件数、相対位置指定(LIMIT, OFFSET)

LIMIT節を記述することで、検索結果の取得個数を制限できます。 また、OFFSETを指定することで、検索結果の取得の開始位置を指定できます。 LIMIT, OFFSET指定の文法は以下の通り定義されます。

LIMIT (数値) [OFFSET (数値)]

OFFSETは必ずLIMITと共に使用されます。省略するとOFFSET 0と同義です。 LIMIT, OFFSETの数値に負の値や浮動小数点数を指定することはできません。

LIMIT, OFFSETの数値に計算式や関数を指定することはできません。

3.6 実行プラン情報の取得・実行結果の解析

SELECT文の前にEXPLAINまたはEXPLAIN ANALYZEを付けることで、実行プラン情報ならびに実行結果の解析情報が求まります。

取得結果は、ロウと同様の構造からなる、次のエントリの列により構成されます。

名称説明
IDINTEGER型一連のエントリ列における、このエントリの位置を示すIDです。
DEPTHINTEGER型他のエントリとの関係を表すための、深さを表します。このエントリより小さな値のIDを順にたどり、このエントリの深さより1だけ浅いエントリが存在した場合、このエントリは、該当するエントリの内容をより詳しく説明するためのものであることを意味します。
TYPE文字列型このエントリが示す情報の種別を表します。実行時間といった解析結果の種別、クエリプランの構成要素の種別などを表します。
VALUE_TYPE文字列型このエントリが示す情報に対応付けられた値の型を表します。実行時間といった解析結果などに対応する値の型を返します。型の名称は、TQLで定義された基本型のものと同一です。値が対応づけられていない場合は空文字列が設定されます。
VALUE文字列型このエントリが示す情報に対応付けられた値の文字列表現を表します。値が対応づけられていない場合は空文字列が設定されます。
STATEMENT文字列型このエントリが示す情報に対応するTQL文の一部を返します。対応関係を持たない場合は空文字列が設定されます。

3.6.1 EXPLAIN

後続のSELECT文に関する実行プラン情報を求めます。SELECT文自体は実行しません。

同一のクエリ文であっても、索引設定などにより結果が異なる場合があります。

3.6.2 EXPLAIN ANALYZE

後続のSELECT文に関する実行プラン情報を取得するとともに、SELECT文を実行し、実行時間などの解析情報を求めます。

4 トリガ機能

トリガが設定されたコンテナに対して更新操作(ロウの登録/更新、削除)がなされた時、Java Messaging Service(JMS)またはRESTを用いて通知を行なうことができます。 前者をJMS通知、後者をREST通知と呼びます。

4.1 機能概要

  • API操作
    • APIで操作できる機能は、トリガ設定、トリガ解除、トリガ情報取得の3つです。
  • 通知タイミング
    • ロウの新規作成または更新、削除が行われたタイミングで通知を行ないます。
    • レプリケーション完了までは待ちません。また、自動コミットモードでない場合は、未コミットの状態で通知を行ないます。
  • 通知内容
    • コンテナ名、操作の種類(ロウの新規作成または更新、削除)、を通知します。
    • 通知対象カラムの指定がある場合、操作が行われたロウの指定されたカラムの値も併せて通知します。
  • エラー発生時の処理
    • 通知時にエラーが発生した場合はイベントログにエラー情報を記録します。再送は行いません。
  • その他
    • 複数のロウを一括して新規作成・更新する操作を行った場合、個別のロウ単位で通知を行ないます。この操作は、Java APIの場合Container#put(java.util.Collection)もしくはGridStore#multiPut(Map)の呼び出しに相当します。
    • トリガが設定されたコンテナのスキーマを変更した場合、トリガは変更後のコンテナに引き継がれますが、変更後のスキーマに含まれないカラムは通知対象カラム名集合から自動的に削除されます。
    • 同一のコンテナに対しJMS通知とREST通知の両方を設定することは可能ですが、トリガ名は別にする必要があります。

4.2 API概要

  • トリガ設定
    • void Container#createTrigger(TriggerInfo info)
    • コンテナにトリガを設定します。
    • JMS通知・REST通知共通の設定内容として、トリガ名、通知方法、監視対象操作(ロウの新規作成または更新、削除)、通知対象カラム、通知先URI、があります。また、JMS通知だけの設定内容として、ディスティネーション名、ユーザ名、パスワード、があります。これらの情報はTriggerInfoオブジェクト経由で設定します。
    • トリガ名はコンテナごとにユニークでなければなりません。
    • 既に設定済のトリガ名を指定して設定した場合、設定内容を上書きします。
    • トリガ設定時に通知先URI、デスティネーション名、ユーザ名、パスワードの有効性は確認しません。
    • JMS通知について
      • ユーザ名、パスワードが未設定の場合はユーザ名、パスワードを使用せずに接続を行ないます。
      • 通知モードはSession#AUTO_ACKNOWLEDGE、配信モードはDeliveryMode#PERSISTENTとします。
JMS通知REST通知
トリガ名
通知方法
監視対象更新操作
通知対象カラム
通知先URL
デスティネーション種別
デスティネーション名
ユーザ名
パスワード
  • トリガ解除
    • void Container#dropTrigger(String name)
    • コンテナに設定されていたトリガを解除します。
  • トリガ情報取得
    • List<TriggerInfo> ContainerInfo#getTriggerInfoList()
    • トリガの設定情報を取得します。Containerオブジェクトに対してgetContainerInfo()を実行して得られるContainerInfoオブジェクトを用います。

4.3 メッセージフォーマット

  • JMS通知
    • 送信側
      • プロパティにコンテナ名、更新操作の種類、ロウデータを設定します。ボディには何も設定されません。
    • 受信側
      • メッセージの種類、ロウデータのスキーマを知っていることを前提とします。
      • JMSのTextMessageを使用して通知内容を取得します。プロパティ名の一覧はTextMessage#getPropetyNames()で得られます。
      • コンテナ名
        • プロパティ名は@containerです。ロウデータのカラム名と重複しないように先頭に@を付けます。
        • TextMessage#getStringProperty()で取得します。例: getStringProperty("@container")
      • 更新操作の種類
        • プロパティ名は@eventです。ロウデータのカラム名と重複しないように先頭に@を付けます。更新操作の種類は"put"・"delete"の2種類です。
        • TextMessage#getStringProperty()で取得します。例: getStringProperty("@event")
      • ロウデータ
        • ブール型、整数型、浮動小数点型は型に対応するTextMessage#getXXXProperty()で取得します。例: FLOAT型はgetFloatProperty("カラム名")
        • 時刻型は送信側で時刻1970-01-01T00:00:00Zからの経過時間(LONG型)に変換した値を設定します。そのため、受信側ではTextMessage#getLongProperty()で取得した値を時刻型に戻してください。

        -BLOB型・配列型は、TextMessage#getStringProperty()で取得します。送信側で空文字列を設定するため、必ず空文字列となります。

  • REST通知
    • 送信側
      • 以下のJSON文字列をHTTPリクエストのボディに設定してPOSTします。
      • "row"の値は指定された通知対象カラムのみを設定します。指定がない場合は"row"自体を設定しません。
      • "row"の各カラムの値は以下の値とします。
        • ブール型: "true"(真)もしくは"false"(偽)
        • 整数型・時刻型: 整数
        • 浮動小数点型: 浮動小数点
        • 文字列型: 文字列
        • BLOB型・配列型: 空文字列
※JSON文字列
{
  "container":"(コンテナ名)",
  "event":"(更新操作の種類)",
  "row":{
    "(カラム名0)":"(カラム名0の値)",
    "(カラム名1)":"(カラム名1の値)",
    "(カラム名2)":"(カラム名2の値)",
    ...
  }
}

4.4 注意事項

  • トリガ設定と更新性能に関する注意
    • トリガが発火するコンテナ数、及び発火するトリガ数に応じて更新性能が低下します。トリガが必要なコンテナだけに最小限のトリガ付与を行うようにしてください。
  • トリガ通知先サーバの処理性能に関する注意
    • GridDBの更新処理のスループットに比べて通知先サーバのスループットが極端に低い場合、トリガ処理に失敗しイベントログにエラーメッセージが記録されることがあります。トリガ設定されているコンテナを高頻度で更新する場合、通知先サーバの性能も確認、調整してください。

5 API (Java)

5.1 API一覧(Java)

Package com.toshiba.mwcloud.gs

Defines public interface of GridData.

See: Description

  • Interface Summary 
    Interface Description
    AggregationResult
    Stores the result of an aggregation operation.
    Collection<K,R>
    A general-purpose Container for managing a set of Rows.
    Container<K,R>
    Provides the functions of managing the components of GridDB, each consisting of a set of Rows of a single type.
    GridStore
    A function is provided for processing the data in the connected GridDB system.
    PartitionController
    Controller for acquiring and processing the partition status.
    Query<R>
    Provides the functions of holding the information about a query related to a specific Container, specifying the options for fetching and retrieving the result.
    Row
    A general-purpose Row for managing fields in any schema.
    RowSet<R>
    Manages a set of Rows obtained by executing a query.
    TimeSeries<R>
    A specialized Container with a time-type Row key for TimeSeries data operation.
  • Class Summary 
    Class Description
    ColumnInfo
    Represents the information about the schema of a Column.
    ContainerInfo
    Represents the information about a specific Container.
    Geometry
    Not supported
    GridStoreFactory
    Manages a GridStore instance.
    QueryAnalysisEntry
    Represents one of information entries composing a query plan and the results of analyzing a query operation.
    RowKeyPredicate<K>
    Represents the condition that a RowKey satisfies.
    TimeSeriesProperties
    Represents the information about optional configuration settings used for newly creating or updating a TimeSeries.
    TimestampUtils
    Provides the utilities for manipulating time data.
    TriggerInfo
    Represent the trigger information for monitoring the Container update.
  • Enum Summary 
    Enum Description
    Aggregation
    Represents the methods of aggregation operation on a set of Rows or their specific Columns.
    CompressionMethod
    Not supported
    ContainerType
    Represents the type(s) of a Container.
    FetchOption
    The options for fetching the result of a query.
    GeometryOperator
    Not supported
    GSType
    Represents the type(s) of field values in GridDB.
    IndexType
    Represents the type(s) of indexes set on a Container.
    InterpolationMode
    Represents the type of interpolation of Rows.
    QueryOrder
    Represents the order of Rows requested by a query.
    TimeOperator
    Represents how to specify a Row based on a key timestamp of TimeSeries.
    TimeUnit
    Represents the time unit(s) used in TimeSeries data operation.
    TriggerInfo.EventType
    Represent the update operation type subject to monitoring by the trigger.
    TriggerInfo.Type
    Represent the trigger type.
  • Exception Summary 
    Exception Description
    GSException
    Represents the exceptions occurring during a process of a GridDB function.
    GSTimeoutException
    Represents the exceptions indicating that the requested operation operation did not finish within a nomal time.
  • Annotation Types Summary 
    Annotation Type Description
    RowField
    Sets options for mapping Row fields of a Container.
    RowKey
    Indicates the correspondence with a key of Container.
    TransientRowField
    Specifies a Row field not to be mapped in operations on a Container.

Package com.toshiba.mwcloud.gs Description

Defines public interface of GridData.

Enum Aggregation

  • java.lang.Object
    • java.lang.Enum<Aggregation>
      • com.toshiba.mwcloud.gs.Aggregation
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Aggregation>


    public enum Aggregation
    extends java.lang.Enum<Aggregation>
    Represents the methods of aggregation operation on a set of Rows or their specific Columns.

    Available only to TimeSeries in the current version.

    In a weighted operation, a weighted value is determined based on a key value. In a weighted operation on a TimeSeries, a weighted value is obtained by calculating half the time span between the adjacent Rows before and after a Row in terms of the specific unit. However, if a Row has only one adjacent Row, the time span from the adjacent Row is considered, and if no adjacent Rows exist, 1 (sec.) is used as a weighted value.

    If an overflow occurs in an internal operation, -INF or INF is returned for floating point operation, and the value "undefined" is returned for integer operation. And if NaN is given as an operand for floating-point operation, NaN is returned.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      AVERAGE
      An operation to obtain an average.
      COUNT
      An operation to obtain the number of samples, i.e., the number of Rows.
      MAXIMUM
      An operation to obtain a maximum value.
      MINIMUM
      An operation to obtain a minimum value.
      STANDARD_DEVIATION
      An operation to obtain a standard deviation.
      TOTAL
      An operation to obtain a sum total.
      VARIANCE
      An operation to obtain a variance.
      WEIGHTED_AVERAGE
      An operation to obtain a weighted average.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static Aggregation valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Aggregation[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • AVERAGE

        public static final Aggregation AVERAGE
        An operation to obtain an average.

        Available only to numeric-type Columns. The type of a returned value is always DOUBLE. If no target Row exists, the aggregation result will not be stored in a result object.

      • COUNT

        public static final Aggregation COUNT
        An operation to obtain the number of samples, i.e., the number of Rows.

        Available to any kinds of Columns. The type of a returned value is always LONG. If no target Row exists, the aggregation result will not be stored in a result object.

      • MAXIMUM

        public static final Aggregation MAXIMUM
        An operation to obtain a maximum value.

        Available only to Columns of numeric and time types allowing magnitude comparison. The type of a returned value is the same as that of a specified Column. If no target Row exists, the aggregation result will not be stored in a result object.

      • MINIMUM

        public static final Aggregation MINIMUM
        An operation to obtain a minimum value.

        Available only to Columns of numeric and time types allowing magnitude comparison. The type of a returned value is the same as that of a specified Column. If no target Row exists, the aggregation result will not be stored in a result object.

      • STANDARD_DEVIATION

        public static final Aggregation STANDARD_DEVIATION
        An operation to obtain a standard deviation.

        Available only to numeric-type Columns. The type of a returned value is always DOUBLE. If no target Row exists, the aggregation result will not be stored in a result object.

      • TOTAL

        public static final Aggregation TOTAL
        An operation to obtain a sum total.

        Available only to numeric-type Columns. The type of a returned value is LONG if a specified Column is of integer type, and DOUBLE if it is of floating-point type. If no target Row exists, the aggregation result will not be stored in a result object.

      • VARIANCE

        public static final Aggregation VARIANCE
        An operation to obtain a variance.

        Available only to numeric-type Columns. The type of a returned value is always DOUBLE. If no target Row exists, the aggregation result will not be stored in a result object.

      • WEIGHTED_AVERAGE

        public static final Aggregation WEIGHTED_AVERAGE
        An operation to obtain a weighted average.

        The weighted average is calculated by dividing the sum of products of sample values and their respective weighted values by the sum of weighted values. For the method of calculating a weighted value, see the description of Aggregation.

        This operation is only available to numeric-type Columns. The type of a returned value is always DOUBLE. If no target Row exists, the aggregation result will not be stored in a result object.

    • Method Detail

      • valueOf

        public static Aggregation valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static Aggregation[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Aggregation c : Aggregation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Interface AggregationResult



  • public interface AggregationResult
    Stores the result of an aggregation operation.

    Stores the result returned by an aggregation Query or TimeSeries.aggregate(Date, Date, String, Aggregation). A floating-point-type result can be obtained from an operation on a numeric-type Column, and a higher-precision result can be obtained from an operation on a numeric-type Column with a small number of significant digits.

    The type of the stored result depends on the type of aggregation operation and the type of the target Columns. For specific rules, see Aggregation or the TQL specifications.

    The type of obtaining value depends on the stored type. DOUBLE type and LONG type are only available when a result is of numeric type, and TIMESTAMP type when a result is of TIMESTAMP type.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.Double getDouble()
      Obtains the result of aggregating numeric-type values in DOUBLE type (Double).
      java.lang.Long getLong()
      Obtains the result of aggregating numeric-type values in LONG type (Long).
      java.util.Date getTimestamp()
      Obtains the result of aggregating time-type values in TIMESTAMP type (Date).
    • Method Detail

      • getDouble

        java.lang.Double getDouble()
        Obtains the result of aggregating numeric-type values in DOUBLE type (Double).

        It returns null if a result is not of numeric type. If a result is not of DOUBLE type, it returns the value converted to DOUBLE.

        Returns:
        Result of aggregating DOUBLE type (Double). If the type of result is different, returns null.
      • getLong

        java.lang.Long getLong()
        Obtains the result of aggregating numeric-type values in LONG type (Long).

        It returns null if a result is not of numeric type. If a result is not of LONG type, it returns the value converted to LONG.

        Returns:
        Result of aggregating LONG type (Long). If the type of result is different, returns null.
      • getTimestamp

        java.util.Date getTimestamp()
        Obtains the result of aggregating time-type values in TIMESTAMP type (Date).

        It returns null if a result is not of TIMESTAMP type.

        Returns:
        Result of aggregating TIMESTAMP type (Date). If the type of result is different, returns null.

Interface Collection<K,R>

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable, Container<K,R>


    public interface Collection<K,R>
    extends Container<K,R>
    A general-purpose Container for managing a set of Rows.

    The following types are available as a Row key.

    • String type (String)
    • INTEGER type (Integer)
    • LONG type (Long)
    • TIMESTAMP type (Date)
    It is not mandatory to set a Row key.

    There is no Container-specific constraint on Row operations.

    A set of Rows retuned by Container.query(String) or GridStore.multiGet(java.util.Map) etc. in no particular order, when order is not specified.

    The granularity of locking is a Row.


Class ColumnInfo

  • java.lang.Object
    • com.toshiba.mwcloud.gs.ColumnInfo


  • public class ColumnInfo
    extends java.lang.Object
    Represents the information about the schema of a Column.

    It does not guarantee the validity of values e.g. the Column name and the type of index for the type of a Column.

    • Constructor Summary

      Constructors 
      Constructor and Description
      ColumnInfo(java.lang.String name, GSType type)
      Creates the information with the specified Column name and type of Column.
      ColumnInfo(java.lang.String name, GSType type, java.util.Set<IndexType> indexTypes)
      Creates the information with the specified Column name and type of Column and set of Index type.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.util.Set<IndexType> getIndexTypes()
      Returns all of set of index type.
      java.lang.String getName()
      Returns a name of Column.
      GSType getType()
      Returns the type of a Column, i.e., the type of each field value corresponding to a Column.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ColumnInfo

        public ColumnInfo(java.lang.String name,
                  GSType type)
        Creates the information with the specified Column name and type of Column.
        Parameters:
        name - Column name. null indicates no specification of Column name.
        type - Column type. null indicates no specification of Column type.
      • ColumnInfo

        public ColumnInfo(java.lang.String name,
                  GSType type,
                  java.util.Set<IndexType> indexTypes)
        Creates the information with the specified Column name and type of Column and set of Index type.

        Creates a copy of a specified non-empty set of Index type copied.

        Parameters:
        name - Column name. null indicates no specification of Column name.
        type - Column type. null indicates no specification of Column type.
        indexTypes - Set of index type. null indicates no specification. No index type is set if it is an empty set.
    • Method Detail

      • getIndexTypes

        public java.util.Set<IndexType> getIndexTypes()
        Returns all of set of index type.

        UnsupportedOperationException can occur when value of the returned object is updated. And value of the returned object is not changed by updating this object.

        Returns:
        Set of index type, or null if unspecified.
      • getName

        public java.lang.String getName()
        Returns a name of Column.
        Returns:
        Name of Column, or null if unspecified.
      • getType

        public GSType getType()
        Returns the type of a Column, i.e., the type of each field value corresponding to a Column.
        Returns:
        Type of Column, or null if unspecified.

Enum CompressionMethod

  • java.lang.Object
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CompressionMethod>


    public enum CompressionMethod
    extends java.lang.Enum<CompressionMethod>
    Not supported
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      HI
      Not supported
      NO
      Not supported
      SS
      Not supported
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static CompressionMethod valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static CompressionMethod[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • valueOf

        public static CompressionMethod valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static CompressionMethod[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CompressionMethod c : CompressionMethod.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Interface Container<K,R>

  • Type Parameters:
    K - the type of a Row key. If no Row key is used, specify Void.
    R - the type of a Row object used for mapping
    All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Subinterfaces:
    Collection<K,R>, TimeSeries<R>


    public interface Container<K,R>
    extends java.io.Closeable
    Provides the functions of managing the components of GridDB, each consisting of a set of Rows of a single type.

    It provides various management functions treating a Row object as a unit of input/output. A Row object and a Row in GridDB are mapped to each other, based on the correspondence between the specified type of a Row object and the schema defined in GridDB.

    Each Column composing a schema in GridDB has a correspondence relation with a field and methods defined in a Row object. The number of Columns is from 1 to 1024 per Container. The correspondence relation with each column is determined based on the public, protected and default access fields of the specified type or the getter and setter methods, excluding fields and methods specified as TransientRowField and transient fields. A default constructor with a public, protected or default access modifier must be prepared to generate a Row object dynamically. Internal classes must be static.

    The getter is a method with no parameters which has a name beginning with "is" or "get" if it return a Boolean value, or a name with beginning with "get" if it returns any other type value. The setter is a method with only one parameter specifying a setting value which has a name beginning with "set." The Column names used in GridDB correspond with the character strings obtained by removing prefixes, such as "get," from the names of getter and setter methods. A Column name must be composed of ASCII alphanumeric characters and underscores ("_"). And the first character must not be numeric. Since Column names are case-insensitive, you cannot differentiate upper- and lowercase letters in a Column name. If either (not both) of a getter or a setter is only defined, it is ignored. If a field with the same name and both of a getter and a setter are defined, the getter and the setter are used. If there is a difference in case between a getter and a setter, the getter is given priority. If a Column has a Row key, RowKey is set on the corresponding field or methods.

    The correspondence between the type of a Column and the type of each value in a Row object is as follows:

    Column type
    Column typeType of each value in a Row object
    STRINGString
    BOOLBoolean or boolean
    BYTEByte or byte
    SHORTShort or short
    INTEGERInteger or int
    LONGLong or long
    FLOATFloat or float
    DOUBLEDouble or double
    TIMESTAMPDate
    BLOBClass implementing Blob
    STRING arrayString[]
    BOOL arrayboolean[]
    BYTE arraybyte[]
    SHORT arrayshort[]
    INTEGER arrayint[]
    LONG arraylong[]
    FLOAT arrayfloat[]
    DOUBLE arraydouble[]
    TIMESTAMP arrayjava.util.Date[]

    There is an upper limit to the number of columns and length of the column name. In addition, the display range and size are limited in the field value. Refer specifically to "System limiting values" in the GridDB API Reference. Values contrary to the restriction cannot be stored in a Container.

    Restrictions such as the datatypes permitted as a Row key, existence of columns corresponding to the Row key, and permissibility of Row operations differ depending on the definition of the sub-interfaces of this Container.

    During transaction processing, the auto commit mode is enabled by default. In the auto commit mode, change operations are confirmed sequentially and cannot be deleted explicitly. In the manual commit mode, if an error in the cluster node is detected by an operation via this object and GSException is sent out, all update operations before committing are deleted. The transaction separation level supports only READ COMMITTED. The lock particle size differs depending on the type of Container.

    After generation or transaction of this Container ends, a new transaction is started at the point the Row is first updated, added or deleted, and the lock for updating purposes is acquired. In the auto commit mode, when the Row operation which started the transaction ends, the transaction is automatically committed and ended. In the manual commit mode, a transaction will not be ended until the validity period for controlling the transaction explicitly is reached. commit() is used to commit a transaction while abort() is used to abort a transaction. Even if this Container or the GridStore of the generation source is closed, the transaction will be aborted and ended. In addition, the time an operation is carried out to start a transaction is adopted as the start point, and the validity period is reached only when the period defined in GridDB has passed. When you try to continue with the Row operations and transaction commitment without aborting after the validity period is reached, GSException will be sent out.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void abort()
      Rolls back the result of the current transaction and starts a new transaction in the manual commit mode.
      void close()
      Disconnects with GridDB and releases related resources as necessary.
      void commit()
      Commits the result of the current transaction and start a new transaction in the manual commit mode.
      java.sql.Blob createBlob()
      Creates a Blob to store a large size of binary data for a Container.
      void createIndex(java.lang.String columnName)
      Creates a default type of index on the specified Column.
      void createIndex(java.lang.String columnName, IndexType type)
      Creates a specified type of index on the specified Column.
      R createRow()
      Create a new Row object based on the column layout of this Container.
      void createTrigger(TriggerInfo info)
      Set the trigger.
      void dropIndex(java.lang.String columnName)
      Removes a default type of index among indexes on the specified Column.
      void dropIndex(java.lang.String columnName, IndexType type)
      Removes the specified type of index among indexes on the specified Column.
      void dropTrigger(java.lang.String name)
      Delete a trigger.
      void flush()
      Writes the results of earlier updates to a non-volatile storage medium, such as SSD, so as to prevent the data from being lost even if all cluster nodes stop suddenly.
      R get(K key)
      Returns the content of a Row corresponding to the specified Row key.
      R get(K key, boolean forUpdate)
      Returns the content of a Row corresponding to the specified Row key according to the specified option.
      ContainerType getType()
      Get the type of this Container.
      boolean put(java.util.Collection<R> rowCollection)
      Based on the specified Row object group, an arbitrary number of Rows will be consolidated to create a new group or updated.
      boolean put(K key, R row)
      Newly creates or updates a Row, based on the specified Row object and also the Row key specified as needed.
      boolean put(R row)
      Newly creates or updates a Row, based on the specified Row object only.
      Query<R> query(java.lang.String tql)
      Creates a query object to execute the specified TQL statement.
      <S> Query<S> query(java.lang.String tql, java.lang.Class<S> rowType)
      Creates a query object to execute the specified TQL statement and return the specified type of result.
      boolean remove(K key)
      Deletes a Row corresponding to the specified Row key.
      void setAutoCommit(boolean enabled)
      Change the setting of the commit mode.
    • Method Detail

      • abort

        void abort()
                   throws GSException
        Rolls back the result of the current transaction and starts a new transaction in the manual commit mode.
        Throws:
        GSException - if called not in the autocommit mode.
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted or a connection failure occurs; or if called after the connection is closed.
      • close

        void close()
                   throws GSException
        Disconnects with GridDB and releases related resources as necessary.

        When a transaction is held, uncommitted updates will be rolled back.

        Even if GSException is thrown, the connection and local resources will be released properly. However, the transaction state might remain in GridDB. If the transaction is already closed, no release operation is invoked by this method.

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        GSException - if a connection failure occurs
      • commit

        void commit()
                    throws GSException
        Commits the result of the current transaction and start a new transaction in the manual commit mode.
        Throws:
        GSException - if called not in the autocommit mode
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted or a connection failure occurs; or if called after the connection is closed.
      • createBlob

        java.sql.Blob createBlob()
                                 throws GSException
        Creates a Blob to store a large size of binary data for a Container.

        The created Blob can be used as a Row field. First, set binary data in the Blob using Blob.setBinaryStream(long) etc. and then store it in Container using put(Object) etc.

        At least the following methods can be called on the Blob obtained by this method.

        • Blob.length()
        • Blob.setBinaryStream(long)
        • Blob.setBytes(long, byte[])
        • Blob.setBytes(long, byte[], int, int)
        • Blob.free()

        You do not have to use the Blob created by this method as BLOB to be set on a Row object. You can set an instance of other class implementing Blob, such as SerialBlob. The created Blob does not have any validity period.

        In the current version, since the entire Row is cached in memory, it might be impossible to store larger data than the maximum VM memory size.

        GSException will not be thrown in the current version.

        Throws:
        GSException
      • createIndex

        void createIndex(java.lang.String columnName)
                         throws GSException
        Creates a default type of index on the specified Column.

        In a Container created using GridStoreFactory.getInstance(), the following types of indexes are selected by default, depending on the type of Container, the type of a corresponding Column, etc.

        Column typeCollectionTimeSeries
        STRING IndexType.TREE IndexType.TREE
        BOOL IndexType.TREE IndexType.TREE
        Numeric type IndexType.TREE IndexType.TREE
        TIMESTAMP IndexType.TREE IndexType.TREE * With some limitations
        BLOB (-) (-)
        Array type (-) (-)
        No index cannot be set on a TimeSeries Row key (TIMESTAMP type).

        If an index is already set on the specified Column, nothing is changed.

        When a transaction(s) is active in a target Container, it creates an index after waiting for the transaction(s) to complete.

        Throws:
        GSException - if no Column has the specified name.
        GSException - if a timeout occurs during this operation, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed.
        GSException - if indexing is not supported on the specified Column.
        java.lang.NullPointerException - if a null parameter is specified.
      • createIndex

        void createIndex(java.lang.String columnName,
                       IndexType type)
                         throws GSException
        Creates a specified type of index on the specified Column.

        The supported types of indexes are different depending on the types of a Column and a Container. See the definition of IndexType.

        If an index is already set on the specified Column, nothing is changed.

        When a transaction(s) is active in a target Container, it creates an index after waiting for the transaction(s) to complete.

        Throws:
        GSException - if no Column has the specified name.
        GSException - if a timeout occurs during this operation, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed.
        GSException - if the specified type of index is not supported on the specified Column type.
        java.lang.NullPointerException - if a null parameter(s) is specified.
      • createRow

        R createRow()
                    throws GSException
        Create a new Row object based on the column layout of this Container.

        If the Row object type of the Container is Row, a fixed default value is set in each field of the Row to be created, similar to the case when it is created using a GridStore.createRow(ContainerInfo). In this case, the operation on the created Row also does not affect whether this Container object is closed or not.

        Throws:
        GSException - If an exclusion is sent out when creating a user-defined Row object
        GSException - If invoked after being closed
      • createTrigger

        void createTrigger(TriggerInfo info)
                           throws GSException
        Set the trigger.

        If a update operation of a specific type is carried out on this Container, a notification will be sent to the specified URI. If a trigger with the same name as the specified trigger exists, the setting will be overwritten.

        Refer to the definition of TriggerInfo for the detailed trigger settings. The details of the trigger type, notification conditions, notification destination URI and notification contents are as shown below.

        Trigger type

        The following trigger types are supported.

        namedescription
        REST Trigger to notify the specified URI with a REST notification (HTTP POST method) when an update operation of the specified type is carried out on a Container.
        Java Message Service(JMS) Trigger to send a JMS message to the JMS server of the specified URI when an update operation of the specified type is carried out on a Container. Apache ActiveMQ is used as the JMS provider.
        Notification condition

        Create new Row/ update Row for this Container (put(Object), put(Object, Object), put(java.util.Collection), GridStore.multiPut(java.util.Map), RowSet.update(Object)), delete (remove(Object), RowSet.remove()) Perform notification immediately after executing operation command. If multiple operations are specified as monitoring targets, perform notification after executing any one of these operations.

        Completion of replication at the point notification is carried out is not guaranteed. For notifications corresponding to a create new Row/ update Row or delete command that has been executed by disabling the auto commit mode, if the transaction is not committed at the point of the notification, or if the transaction is aborted after the notification, it may not be possible to get the data included in the notification at the point the notification is received.

        For batch operations involving multiple Rows, notification is carried out for each Row operation. If there is no response within a specified time even if notification has been sent to the specified URl, time out is performed and it will not be sent again. If a failure occurs in a GridDB cluster, in addition to not sending any notification to support a certain update operation, multiple notifications may be sent.

        Notification destination URI

        A notification destination URI is described in the following format.

         (method name)://(host name):(port number)/(path)
        However, if the trigger type is REST, only http can be specified in the method name.

        Notification contents

        Provide notification of the updated Container name, update operation name, and specified column value of the updated Row data. For the update operation name, use "put" to create a new Row/ update Row and "delete" to delete.

        The notification value shall be the specified column value of the Row data that is newly created immediately after a new Row is created, or updated in an update operation, or before deletion in a delete operation. If the column type is TIMESTAMP, an integer to indicate the time passed in milliseconds starting from 1970-01-01T00:00:00Z is set as the value. If the column type if BLOB, GEOMETRY, or array, a blank character string will be set as the value.

        Notification method - For REST

        JSON character strings such as those shown below are sent with the MIME type application/json.

         {
           "container" : "(container name)",
           "event" : "(update operation name)",
           "row" : {
             "(column name)" : (column data),
             "(column name)" : (column data),
             ...
           }
         }

        Notification method - For JMS

        A javax.jms.TextMessage is sent with the specified destination type and destination name.

        The container name is set by javax.jms.Message#setStringProperty("@container", "(container name)"). The update operation name is set by javax.jms.Message#setStringProperty("@event", "(update operation name)").

        The column value is set with a javax.jms.Message#setXXXProperty("(column name)", (column data)) in accordance with the column type.

        When the column layout is changed by a GridStore.putCollection(String, Class, boolean), GridStore.putTimeSeries(String, Class, TimeSeriesProperties, boolean), etc. in relation to a Container with a set trigger, if a column subject to trigger notification is deleted or if its name is changed, the corresponding column will be deleted from the trigger notification targets.

        If the server does not respond to a request sent to the notification destination URI that has been set up when sending a notification from GridDB, standby processing will occur until the process times out. This standby process becomes a cause for the delay in serving notification of an update in the Container as well as some other containers. Therefore, a trigger having an invalid notification destination URI is recommended to be deleted by using dropTrigger(String).

        Refer to "System limiting values" in the GridDB API Reference for the maximum number of triggers that can be set for a single Container and the upper limit of the values for various trigger settings.

        Parameters:
        info - Trigger information of the setting target
        Throws:
        GSException - If the trigger name is null, or blank
        GSException - If the update operation subject to monitoring is not specified
        GSException - If the notification destination URI does not conform to the stipulated syntax
        GSException - If the JMS is specified by the trigger type, and the JMS destination type is null, or is blank, or does not conform to the specified format
        GSException - If the JMS is specified by the trigger type, and the JMS destination name is null, or is blank
        GSException - If the JMS is specified by the trigger type, and the JMS destination name is null, or is blank
        java.lang.NullPointerException - If null is specified in the argument
      • dropIndex

        void dropIndex(java.lang.String columnName)
                       throws GSException
        Removes a default type of index among indexes on the specified Column.

        The default type of index in a Container created using GridStoreFactory.getInstance() is the same as defined by createIndex(String).

        If no index is set, nothing is changed.

        When a transaction(s) is active in a target Container, it removes the index after waiting for the transaction(s) to complete.

        Throws:
        GSException - if no Column has the specified name.
        GSException - if a timeout occurs during this operation, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if a null parameter is specified.
      • dropIndex

        void dropIndex(java.lang.String columnName,
                     IndexType type)
                       throws GSException
        Removes the specified type of index among indexes on the specified Column.

        If the specified index is not found, nothing is changed.

        When a transaction(s) is active in a target Container, it removes the index after waiting for the transaction(s) to complete.

        Throws:
        GSException - if no Column has the specified name.
        GSException - if a timeout occurs during this operation, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if null is specified as more than one parameter.
      • dropTrigger

        void dropTrigger(java.lang.String name)
                         throws GSException
        Delete a trigger.

        Nothing is changed if the trigger of the specified name does not exist.

        Throws:
        GSException - If this process times out, this Container is deleted, a connection failure were to occur, or if it is invoked after being closed
        java.lang.NullPointerException - If null is specified in the argument
      • flush

        void flush()
                   throws GSException
        Writes the results of earlier updates to a non-volatile storage medium, such as SSD, so as to prevent the data from being lost even if all cluster nodes stop suddenly.

        It can be used for operations requiring higher reliability than normal. However, frequent execution of this would cause degradation in response time.

        Its behaviors vary, such as the scope of cluster nodes concerned, depending on the configuration of GridDB.

        Throws:
        GSException - if a timeout occurs during this operation, this Container is deleted or a connection failure occurs; or if called after the connection is closed.
      • get

        R get(K key,
            boolean forUpdate)
              throws GSException
        Returns the content of a Row corresponding to the specified Row key according to the specified option.

        It can be used only if a Column exists which corresponds to the specified Row key.

        If it requests a lock for update in the manual commit mode, it will hold the lock until a relevant transaction completes or a timeout occurs. The update or deletion operation by any other transaction on the locked Row will wait until the transaction completes or a timeout occurs. The lock will be held even if the target Row is deleted.

        In the autocommit mode, it cannot request a lock for update.

        Parameters:
        forUpdate - indicates whether it requests a lock for update.
        Returns:
        A target Row object. null if no target Row exists.
        Throws:
        GSException - if no Column exists which corresponds to the specified Row key.
        GSException - if it requests a lock for update in the autocommit mode.
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed; or if an unsupported value is specified as key.
        java.lang.ClassCastException - if the specified Row key does not match the type of a Row key used in mapping operation.
        java.lang.NullPointerException - if null is specified as key.
      • getType

        ContainerType getType()
                              throws GSException
        Get the type of this Container.

        In the current version, no inquiry is sent to the GridDB cluster by this operation as the type is always confirmed at the point the instance is generated.

        Throws:
        GSException - If invoked after being closed
      • put

        boolean put(java.util.Collection<R> rowCollection)
                    throws GSException
        Based on the specified Row object group, an arbitrary number of Rows will be consolidated to create a new group or updated.

        For each Row in the specified Row object group, a new creation or update operation is carried out just like the case when put(Object) is invoked in accordance with the take-out sequence from the iterator.

        If multiple Rows having the same Row key exist in the specified Row object group, the contents of the rear-most Row having the same Row key will be reflected using the take-out sequence from the iterator of the Row object group as a reference.

        Depending on the Container type and setting, the same restrictions as put(Object) are established for the contents of Rows that can be operated. Refer to definition of the sub-interface for the specific restrictions.

        In the manual commit mode, the target Rows are locked.

        In the auto commit mode, if an exclusion occurs in the midst of processing a Container and its Rows, only the results for some of the Rows in the Container may remain reflected.

        Returns:
        Always false in the current version
        Throws:
        GSException - When an operation violating the restrictions unique to a specific Container type is carried out
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed; or if an unsupported value is set in the key or the Row object.
        java.lang.ClassCastException - if the specified Row objects does not match the value types of Row objects used in mapping operation, respectively.
        java.lang.NullPointerException - if NULL is specified as rowCollection or its element; or if no object exists in each Row object which corresponds to the Row field.
        See Also:
        put(Object)
      • put

        boolean put(K key,
                  R row)
                    throws GSException
        Newly creates or updates a Row, based on the specified Row object and also the Row key specified as needed.

        If a Column exists which corresponds to the specified Row key, it determines whether to newly create or update a Row, based on the Row key and the state of the Container. If there is no corresponding Row in the Container, it determines to newly create a Row; otherwise, it updates a relevant Row. If a Row key is specified besides a Row object, the specified Row key is used in preference to the Row key in the Row object.

        If no Column exists which corresponds to the specified Row key, it always creates a new Row. In such a case, specify null as key.

        Restrictions are applied depending on the type of Container and its settings. See the descriptions of subinterfaces for detailed restrictions.

        In the manual commit mode, the target Row is locked.

        Parameters:
        key - A target Row key
        row - A Row object representing the content of a Row to be newly created or updated.
        Returns:
        TRUE if a Row exists which corresponds to the specified Row key.
        Throws:
        GSException - if a Row key is specified although no Column exists which corresponds to the key.
        GSException - if its operation is contrary to the restrictions specific to a particular Container.
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed; or if an unsupported value is set in the key or the Row object.
        java.lang.ClassCastException - if the specified key or Row object does not completely match the type(s) used in mapping operation.
        java.lang.NullPointerException - if null is specified as row; or if no object exists in the Row object which corresponds to the Row field.
      • query

        Query<R> query(java.lang.String tql)
                       throws GSException
        Creates a query object to execute the specified TQL statement.

        It cannot be used for a query whose output format does not match the types of Rows in this Container, such as a query containing an aggregation operation in its selection expression. For such a query, query(String, Class) can be used instead.

        When obtaining a set of Rows using Query.fetch(boolean), the option of locking for update can be enabled only for the queries that will not select Rows which do not exist in this Container. For example, it cannot be enabled for a query containing an interpolation operation.

        GSException will not be thrown in the current version.

        Throws:
        java.lang.NullPointerException - if null is specified as tql.
        GSException
        See Also:
        query(String, Class)
      • query

        <S> Query<S> query(java.lang.String tql,
                         java.lang.Class<S> rowType)
                       throws GSException
        Creates a query object to execute the specified TQL statement and return the specified type of result.

        It is used for a query whose output format does not match the types of Rows in this Container, such as an aggregation operation. The following types and null are only available as rowType.

        Row type of Container
        Indicates receiving Row data of the type matching the Rows in this Container, as in query(String).
        AggregationResult
        Indicates receiving the result of executing an aggregation operation.
        QueryAnalysisEntry
        Indicates receiving the result of executing an EXPLAIN or EXPLAIN ANALYZE statement.
        null
        Indicates receiving a proper type of result, depending on the operation.
        No other value can be specified.

        When obtaining a set of Rows using Query.fetch(boolean), the option of locking for update can be enabled only for the queries that will not select Rows which do not exist in this Container. For example, it cannot be enabled for a query containing an interpolation operation.

        Throws:
        GSException - if an unsupported type is specified as rowType.
        java.lang.NullPointerException - if null is specified as tql.
      • remove

        boolean remove(K key)
                       throws GSException
        Deletes a Row corresponding to the specified Row key.

        It can be used only if a Column exists which corresponds to the specified Row key. If no corresponding Row exists, nothing is changed.

        Restrictions are applied depending on the type of Container and its settings. See the descriptions of subinterfaces for detailed restrictions.

        In the manual commit mode, the target Row is locked.

        Returns:
        TRUE if a corresponding Row exists.
        Throws:
        GSException - if no Column exists which corresponds to the specified Row key.
        GSException - if its operation is contrary to the restrictions specific to a particular Container.
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed; or if an unsupported value is specified as key.
        java.lang.ClassCastException - if the specified Row key does not match the type of a Row key used in mapping operation.
        java.lang.NullPointerException - if null is specified.
      • setAutoCommit

        void setAutoCommit(boolean enabled)
                           throws GSException
        Change the setting of the commit mode.

        In the auto commit mode, the transaction state cannot be controlled directly and change operations are committed sequentially. If the auto commit mode is disabled, i.e. in the manual commit mode, as long as the transaction has not timed out or commit() has been invoked directly, the same transaction will continue to be used in this Container and change operations will not be committed.

        When the autocommit mode is switched from On to Off, uncommitted updates are committed implicitly. Unless the commit mode is changed, the state of the transaction will not be changed. These behaviors are the same as those of Connection.setAutoCommit(boolean).

        Throws:
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted or a connection failure occurs, when a commit is requested after a mode change; or if called after the connection is closed.

Class ContainerInfo

  • java.lang.Object
    • com.toshiba.mwcloud.gs.ContainerInfo


  • public class ContainerInfo
    extends java.lang.Object
    Represents the information about a specific Container.

    It does not guarantee the validity of values e.g. notation of the Container name, and the existence of TimeSeries option related to its Container type.

    • Field Detail

      • columnInfoList

        protected java.util.List<ColumnInfo> columnInfoList
      • columnOrderIgnorable

        protected boolean columnOrderIgnorable
      • dataAffinity

        protected java.lang.String dataAffinity
      • name

        protected java.lang.String name
      • rowKeyAssigned

        protected boolean rowKeyAssigned
      • triggerInfoList

        protected java.util.List<TriggerInfo> triggerInfoList
    • Constructor Detail

      • ContainerInfo

        public ContainerInfo()
        Creates an empty ContainerInfo.
      • ContainerInfo

        public ContainerInfo(ContainerInfo containerInfo)
        Duplicates the information about the specified Container.
      • ContainerInfo

        public ContainerInfo(java.lang.String name,
                     ContainerType type,
                     java.util.List<ColumnInfo> columnInfoList,
                     boolean rowKeyAssigned)
    • Method Detail

      • getColumnCount

        public int getColumnCount()
        Returns the number of Columns of the specified Container.
        Returns:
        A number of Columns, or 0 if Column layout is unspecified.
      • getColumnInfo

        public ColumnInfo getColumnInfo(int column)
        Returns the information about the specified Column.
        Parameters:
        column - An index of a Column, from 0 to number of Columns minus one.
        Returns:
        The information of the Column corresponding to the specified index.
        Throws:
        java.lang.IllegalArgumentException - If the specified Column number is out of range.
        See Also:
        RowField.columnNumber()
      • getDataAffinity

        public java.lang.String getDataAffinity()
        Returns a data affinity string of the Container.
        Returns:
        A data affinity string, or null as default.
        See Also:
        setDataAffinity(String)
      • getName

        public java.lang.String getName()
        Returns the name of the specified Container.
        Returns:
        A Container name, or null if unspecified.
      • getTimeSeriesProperties

        public TimeSeriesProperties getTimeSeriesProperties()
        Returns the optional properties of TimeSeries.

        If the contents of the returned object is changed after it has been invoked, it is not defined whether the contents of this content will be changed or not. Moreover, it is not defined whether the contents of the returned object will be changed or not by operating this object.

        Returns:
        The optional properties of TimeSeries, or null if undefined.
      • getTriggerInfoList

        public java.util.List<TriggerInfo> getTriggerInfoList()
        Returns a list of the trigger information.

        UnsupportedOperationException can occur when the returned value is updated. After objects are returned, updates of this object do not change the returned object.

        Returns:
        A list of the trigger information.
      • getType

        public ContainerType getType()
        Returns the Container type of the specified Container.
        Returns:
        A Container type, or null if unspecified.
        See Also:
        ContainerType
      • isColumnOrderIgnorable

        public boolean isColumnOrderIgnorable()
        Checks if the order of Columns can be ignored.
        Returns:
        true if yes, otherwise false.
      • isRowKeyAssigned

        public boolean isRowKeyAssigned()
        Checks if a Column is assigned as a Row key.

        If the Container has a Row key, the number of its corresponding Column is 0.

        Returns:
        true If a Row key is assigned, otherwise false.
      • setColumnInfoList

        public void setColumnInfoList(java.util.List<ColumnInfo> columnInfoList)
        Set information of all Columns all at once.

        The order of the Columns of the Container corresponds to the order of information of the Columns, if its can be ignored.

        It can be undefined, regardless of the existence of a Row key Column.

        Updates of the specified object after this function is specified will not change the object.

        Parameters:
        columnInfoList - List of the information of Columns. For null or an empty list, the setting is cancelled.
        See Also:
        setColumnOrderIgnorable(boolean)
      • setColumnOrderIgnorable

        public void setColumnOrderIgnorable(boolean ignorable)
        Sets whether the order of Columns can be ignored.

        Default value cannot be ignored (false).

        Parameters:
        ignorable - If the order of Columns can be ignored
        See Also:
        GridStore.putContainer(String, ContainerInfo, boolean)
      • setDataAffinity

        public void setDataAffinity(java.lang.String dataAffinity)
        Sets a data affinity string of the Container.

        A data affinity string is for optimizing the arrangement of Containers among the nodes of the cluster.

        Containers which have the same data affinity string may be stored near each other. Therefore the efficiency for the expiration of Rows may be improved by using the same data affinity string for TimeSeries Containers which includes Rows with similar elapsed time periods.

        An empty string is not acceptable. A data affinity string must be composed of characters same as a Container name. See "System limiting values" in the GridDB API Reference for the maximum length of the string. A Container with a Container name longer than the maximum length cannot be created.

        Parameters:
        dataAffinity - A data affinity string. If null is specified, the Container will be stored as usual.
        Throws:
        java.lang.IllegalArgumentException - If the specified string is not proper. However, an exception may not occur even if the lenght of the string is exceeded.
      • setName

        public void setName(java.lang.String name)
        Sets a name of the Container.
        Parameters:
        name - A name of the Container. For null, the setting is cancelled.
      • setRowKeyAssigned

        public void setRowKeyAssigned(boolean assigned)
        Sets a Row key Column is assigned or not.

        A Row key is assigned default.

        This function is available regardless of the layout of Columns.

        Parameters:
        assigned - A Row key Column is assigned or not. true for assigned, otherwise false.
      • setTimeSeriesProperties

        public void setTimeSeriesProperties(TimeSeriesProperties props)
        Sets the optional properties of TimeSeries.

        This function is available for any Container type.

        Updates of the specified object after this function is invoked will not change the object.

        Parameters:
        props - The optional properties of TimeSeries. For null, the setting is cancelled.
      • setTriggerInfoList

        public void setTriggerInfoList(java.util.List<TriggerInfo> triggerInfoList)
        Sets all information of triggers.
        Parameters:
        triggerInfoList - A list of trigger information. For null, the setting is cancelled.
      • setType

        public void setType(ContainerType type)
        Sets a type of the Container.
        Parameters:
        type - A type of the Container. For null, the setting is cancelled.

Enum ContainerType

  • java.lang.Object
    • java.lang.Enum<ContainerType>
      • com.toshiba.mwcloud.gs.ContainerType
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ContainerType>


    public enum ContainerType
    extends java.lang.Enum<ContainerType>
    Represents the type(s) of a Container.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      COLLECTION
      Indicates the target Container is a Collection.
      TIME_SERIES
      Indicates the target Container is a TimeSeries.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static ContainerType valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ContainerType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • COLLECTION

        public static final ContainerType COLLECTION
        Indicates the target Container is a Collection.
      • TIME_SERIES

        public static final ContainerType TIME_SERIES
        Indicates the target Container is a TimeSeries.
    • Method Detail

      • valueOf

        public static ContainerType valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static ContainerType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ContainerType c : ContainerType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Enum FetchOption

  • java.lang.Object
    • java.lang.Enum<FetchOption>
      • com.toshiba.mwcloud.gs.FetchOption
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<FetchOption>


    public enum FetchOption
    extends java.lang.Enum<FetchOption>
    The options for fetching the result of a query.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      LIMIT
      Used to set the maximum number of Rows to be fetched.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static FetchOption valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static FetchOption[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • LIMIT

        public static final FetchOption LIMIT
        Used to set the maximum number of Rows to be fetched.

        If the number of Rows in a result exceeds the maximum, the maximum number of Rows counting from the 0-th in RowSet are fetched. The rest of the Rows in the result cannot be fetched.

        The supported types of values are Integer and Long. Negative values are not available. If the setting is omitted, the limit is not defined.

    • Method Detail

      • valueOf

        public static FetchOption valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static FetchOption[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FetchOption c : FetchOption.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Class GSException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.io.IOException
          • com.toshiba.mwcloud.gs.GSException
  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    GSTimeoutException


    public class GSException
    extends java.io.IOException
    Represents the exceptions occurring during a process of a GridDB function.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      GSException() 
      GSException(int errorCode, java.lang.String description) 
      GSException(int errorCode, java.lang.String errorName, java.lang.String description, java.lang.Throwable cause) 
      GSException(int errorCode, java.lang.String description, java.lang.Throwable cause) 
      GSException(int errorCode, java.lang.Throwable cause) 
      GSException(java.lang.String message) 
      GSException(java.lang.String message, java.lang.Throwable cause) 
      GSException(java.lang.Throwable cause) 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      int getErrorCode()
      Returns an error number.
      java.lang.String getMessage() 
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GSException

        public GSException()
      • GSException

        public GSException(int errorCode,
                   java.lang.String description)
      • GSException

        public GSException(int errorCode,
                   java.lang.String errorName,
                   java.lang.String description,
                   java.lang.Throwable cause)
      • GSException

        public GSException(int errorCode,
                   java.lang.String description,
                   java.lang.Throwable cause)
      • GSException

        public GSException(int errorCode,
                   java.lang.Throwable cause)
      • GSException

        public GSException(java.lang.String message)
      • GSException

        public GSException(java.lang.String message,
                   java.lang.Throwable cause)
      • GSException

        public GSException(java.lang.Throwable cause)
    • Method Detail

      • getErrorCode

        public int getErrorCode()
        Returns an error number.

        It returns 0 if no corresponding number is found.

      • getMessage

        public java.lang.String getMessage()
        Overrides:
        getMessage in class java.lang.Throwable

Class GSTimeoutException

  • All Implemented Interfaces:
    java.io.Serializable


    public class GSTimeoutException
    extends GSException
    Represents the exceptions indicating that the requested operation operation did not finish within a nomal time.
    See Also:
    Serialized Form
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GSTimeoutException

        public GSTimeoutException()
      • GSTimeoutException

        public GSTimeoutException(int errorCode,
                          java.lang.String description)
      • GSTimeoutException

        public GSTimeoutException(int errorCode,
                          java.lang.String errorName,
                          java.lang.String description,
                          java.lang.Throwable cause)
      • GSTimeoutException

        public GSTimeoutException(int errorCode,
                          java.lang.String description,
                          java.lang.Throwable cause)
      • GSTimeoutException

        public GSTimeoutException(int errorCode,
                          java.lang.Throwable cause)
      • GSTimeoutException

        public GSTimeoutException(java.lang.String message)
      • GSTimeoutException

        public GSTimeoutException(java.lang.String message,
                          java.lang.Throwable cause)
      • GSTimeoutException

        public GSTimeoutException(java.lang.Throwable cause)
  • java.lang.Object
    • java.lang.Enum<GSType>
      • com.toshiba.mwcloud.gs.GSType
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<GSType>


    public enum GSType
    extends java.lang.Enum<GSType>
    Represents the type(s) of field values in GridDB.
    • Enum Constant Detail

      • BLOB

        public static final GSType BLOB
      • BOOL

        public static final GSType BOOL
      • BOOL_ARRAY

        public static final GSType BOOL_ARRAY
      • BYTE

        public static final GSType BYTE
      • BYTE_ARRAY

        public static final GSType BYTE_ARRAY
      • DOUBLE

        public static final GSType DOUBLE
      • DOUBLE_ARRAY

        public static final GSType DOUBLE_ARRAY
      • FLOAT

        public static final GSType FLOAT
      • FLOAT_ARRAY

        public static final GSType FLOAT_ARRAY
      • GEOMETRY

        public static final GSType GEOMETRY
      • INTEGER

        public static final GSType INTEGER
      • INTEGER_ARRAY

        public static final GSType INTEGER_ARRAY
      • LONG

        public static final GSType LONG
      • LONG_ARRAY

        public static final GSType LONG_ARRAY
      • SHORT

        public static final GSType SHORT
      • SHORT_ARRAY

        public static final GSType SHORT_ARRAY
      • STRING

        public static final GSType STRING
      • STRING_ARRAY

        public static final GSType STRING_ARRAY
      • TIMESTAMP

        public static final GSType TIMESTAMP
      • TIMESTAMP_ARRAY

        public static final GSType TIMESTAMP_ARRAY
    • Method Detail

      • valueOf

        public static GSType valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static GSType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (GSType c : GSType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Class Geometry

  • java.lang.Object
    • com.toshiba.mwcloud.gs.Geometry


  • public class Geometry
    extends java.lang.Object
    Not supported
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj)
      Not supported
      int hashCode()
      Not supported
      java.lang.String toString()
      Not supported
      static Geometry valueOf(java.lang.String value)
      Not supported
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • equals

        public boolean equals(java.lang.Object obj)
        Not supported
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Not supported
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Not supported
        Overrides:
        toString in class java.lang.Object
      • valueOf

        public static Geometry valueOf(java.lang.String value)
                                throws java.lang.IllegalArgumentException
        Not supported
        Throws:
        java.lang.IllegalArgumentException

Enum GeometryOperator

  • java.lang.Object
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<GeometryOperator>


    public enum GeometryOperator
    extends java.lang.Enum<GeometryOperator>
    Not supported
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      INTERSECT
      Not supported
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static GeometryOperator valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static GeometryOperator[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

    • Method Detail

      • valueOf

        public static GeometryOperator valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static GeometryOperator[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (GeometryOperator c : GeometryOperator.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Interface GridStore

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable


    public interface GridStore
    extends java.io.Closeable
    A function is provided for processing the data in the connected GridDB system.

    A function to add, delete, or change the composition of Collection and TimeSeries Containers as well as to process the Rows constituting a Container is provided.

    Rows cannot be stored with duplicated names, regardless of whether it is a TimeSeries or Collection Container. Where necessary, the Container name can be specified by appending the node affinity name after the base Container name with the at mark "@". Only ASCII alphanumeric characters and the underscore mark ( "_" ) can be used in the base Container name and node affinity name. ASCII characters are not case-sensitive. Numbers cannot be used in front of the base Container name. Refer to "System limiting values" in the GridDB API Reference for the upper limit of the length of the Container name.

    Thread safety of each method is not guaranteed.

    See Also:
    Collection, TimeSeries, Container
    • Method Detail

      • close

        void close()
                   throws GSException
        Disconnects with GridDB and releases related resources as necessary.

        Even if GSException is thrown, the connection and local resources are released properly. However, the transaction state etc. might remain in GridDB. If the connection is already closed, this method will not work effectively.

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        GSException - if a connection failure occurs
      • createRow

        Row createRow(ContainerInfo info)
                      throws GSException
        Specify ContainerInfo and create a new Row.

        Include the ColumnInfo list and whether there is any Row key so as to conform to the restrictions stipulated in Container. Specify the column layout in ContainerInfo.

        In addition, by including the Container type in ContainerInfo, it can be verified whether the restrictions unique to a specific Container type are conformed to or not. However, the Container type will not be included even if a Row.getSchema() is invoked against the created Row.

        The existing initial value is set in each field of the created Row. This initial value is the same as the value of each field in the column newly added in putContainer(String, ContainerInfo, boolean). Refer to the definition of putCollection(String, Class, boolean) for a list of the specific values.

        The operation on the created Row also does not affect whether this GridStore object is closed or not.

        Parameters:
        info - Container information including the column layout. Other contents are ignored
        Returns:
        Created Row
        Throws:
        GSException - If the Container type or restrictions of the column layout are not conformed to
        GSException - If invoked after being closed
        java.lang.NullPointerException - If null is specified in the argument
        See Also:
        Container
      • dropCollection

        void dropCollection(java.lang.String name)
                            throws GSException
        Deletes a Collection with the specified name.

        If the specified Collection is already deleted, nothing is changed.

        When a transaction(s) is active in a target Collection, it deletes the Collection after waiting for the transaction(s) to complete.

        Parameters:
        name - Name of Collection subject to processing
        Throws:
        GSException - if the Container type is unmatched.
        GSException - if a timeout occurs during this operation or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if a null parameter is specified.
      • dropContainer

        void dropContainer(java.lang.String name)
                           throws GSException
        Delete a Container having the specified name

        Nothing is changed if the Container has already been deleted.

        If a transaction under execution exists in a Container subject to processing, the system will wait for these to be completed before deleting the data.

        Parameters:
        name - Name of a Container subject to processing
        Throws:
        GSException - Name of a Container subject to processing
        java.lang.NullPointerException - If null is specified in the argument
        See Also:
        dropCollection(String), dropTimeSeries(String)
      • dropTimeSeries

        void dropTimeSeries(java.lang.String name)
                            throws GSException
        Deletes a TimeSeries with the specified name.

        If the specified TimeSeries is already deleted, nothing is changed.

        When a transaction(s) is active in a target TimeSeries, it deletes the TimeSeries after waiting for the transaction(s) to complete.

        Parameters:
        name - Name of TimeSeries subject to processing
        Throws:
        GSException - if the Container type is unmatched.
        GSException - if a timeout occurs during this operation or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if a null parameter is specified.
      • fetchAll

        void fetchAll(java.util.List<? extends Query<?>> queryList)
                      throws GSException
        Query execution and fetch is carried out on a specified arbitrary number of Query, with the request unit enlarged as much as possible.

        For each Query included in a specified list, perform a similar query execution and fetch as when Query.fetch() is performed individually and set the RowSet in the results. Use Query.getRowSet() to extract the execution results of each Query. However, unlike the case when carried out individually, the target node is requested for the same storage destination, etc. with a unit that is as large as possible. Based on this, the larger the number of elements in the list, the higher is the possibility that the number of correspondences with the target node will be reduced. Query in a list are not executed in any particular order.

        Only a Query that has not been closed, including corresponding Container acquired via this GridStore object, can be included in a specified list. Like a Query.fetch(), the RowSet formed last and held by each Query will be closed. If the same instance is included multiple times in a list, the behavior will be the same as the case in which the respective instances differ.

        Like other Container or Row operations, consistency between Containers is not guaranteed. Therefore, the processing results for a certain Container may be affected by other operation commands that have been completed prior to the start of the process.

        The commit mode of each Container corresponding to the specified Query can be used in either the auto commit mode or manual commit mode. The transaction status is reflected in the execution results of the query. If the operation is completed normally, the corresponding transaction of each Container will not be aborted so long as the transaction timeout time has not been reached.

        If an exception occurs in the midst of processing each Query, a new RowSet may be set for only some of the Query. In addition, uncommitted transactions of each Query corresponding to the designated Container may be aborted.

        If the system tries to acquire a large number of Rows all at once, the upper limit of the communication buffer size managed by the GridDB node may be reached, possibly resulting in a failure. Refer to "System limiting values" in the GridDB API Reference for the upper limit size.

        Parameters:
        queryList - List of Query targeted
        Throws:
        If - a Query other than a Query obtained via this GridStore object is included
        GSException - If the system tries to execute a query containing a wrong parameter, syntax or command. For example, when a column type that is not compatible with the argument of the function is specified in the TQL. Refer to the various definitions of the function to create this query for the specific restrictions
        GSException - If the execution results do not conform to the expected type of each component of the RowSet, when a TQL is executed.
        GSException - If this process or related transaction times out, if the corresponding Container is deleted or the schema is changed, if a connection failure occurs, or if the corresponding Container is invoked after being closed
        java.lang.NullPointerException - If null is specified in the argument queryList, or if null is included as a component the argument queryList
        java.lang.NullPointerException - If a non-permitted null is included in the parameter given when creating this query. To be executed in GridDB The evaluation results of the TQL text will not be sent out
        See Also:
        Query.fetch()
      • getCollection

        <K,R> Collection<K,R> getCollection(java.lang.String name,
                                          java.lang.Class<R> rowType)
                                      throws GSException
        Return a Collection object to manipulate a Collection with the specified name.

        For the correspondence between a specified type and a Column layout, see the description of Container.

        Parameters:
        name - Name of a Collection subject to processing
        rowType - Type of Row object corresponding to the column layout of the Collection subject to processing
        Returns:
        A Collection object if a Collection with the specified name exist; or null if not.
        Throws:
        GSException - if a TimeSeries with the same name exists.
        GSException - if the specified type and the existing Column layout conflict each other.
        GSException - if the specified type is not proper as a type of a Row object. For more information, see the description of Container.
        GSException - if a timeout occurs during this operation or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if a null parameter(s) is specified.
      • getContainerInfo

        ContainerInfo getContainerInfo(java.lang.String name)
                                       throws GSException
        Get information related to a Container with the specified name.

        A name stored in GridDB is set for the Container name to be included in a returned ContainerInfo. Therefore, compared to the specified Container name, the notation of the ASCII uppercase characters and lowercase characters may differ.

        The column sequence is set to Do Not Ignore. This setting can be verified through ContainerInfo.isColumnOrderIgnorable().

        Parameters:
        name - the target Container name
        Returns:
        Container Info of the specific Container.
        Throws:
        GSException - if a timeout occurs during this operation or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if null is specified as the parameter.
      • getTimeSeries

        <R> TimeSeries<R> getTimeSeries(java.lang.String name,
                                      java.lang.Class<R> rowType)
                                    throws GSException
        Returns a TimeSeries object to manipulate a TimeSeries with the specified name.

        For the correspondence between a specified type and a Column layout, see the description of Container.

        Parameters:
        name - Name of TimeSeries subject to processing
        rowType - Type of Row object corresponding to the column layout of the TimeSeries subject to processing
        Returns:
        A TimeSeries object if a TimeSeries with the specified name exists; or null if not.
        Throws:
        GSException - if a Collection with the same name exists.
        GSException - if the specified type and the existing Column layout conflict each other.
        GSException - if the specified type is not proper as a type of a Row object. For more information, see the description of Container.
        GSException - if a timeout occurs during this operation or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if a null parameter(s) is specified.
      • multiGet

        java.util.Map<java.lang.String,java.util.List<Row>> multiGet(java.util.Map<java.lang.String,? extends RowKeyPredicate<?>> containerPredicateMap)
                                                                     throws GSException
        Get an arbitrary number and range of Rows of a Container based on the specified conditions, with the request unit enlarged as much as possible.

        Get the Row contents in accordance with the conditions included in the specified map, similar to invoking Container.get(Object) or Query.fetch() individually. However, unlike the case when carried out individually, the target node is requested for the same storage destination, etc. with a unit that is as large as possible. Based on this, the larger the total number of Rows conforming to the conditions and the larger the total number of target Containers, the higher is the possibility that the number of correspondences with the target node will be reduced.

        A specified map is composed of an arbitrary number of entries that adopt the Container name as the key and the acquisition condition represented by RowKeyPredicate as the value. Multiple instances with the same RowKeyPredicate can also be included. In addition, a subject Container may be a mixture of different Container types and column layouts. However, there are some acquisition conditions that cannot be evaluated due to the composition of the Container. Refer to the definitions of the various setting functions for RowKeyPredicate for the specific restrictions. In addition, the specified Container name must be a real Container. The Container cannot include null as a key or value of the map.

        A returned map is composed of entries that adopt the Container name as its key and list of Row objects as its value. All the Container names included in a specified map as acquisition conditions are included in a returned map. If the same Container is specified and multiple entries in which Container names with different notations in uppercase and lowercase letters are set are included in a specified map, a single entry consolidating these is stored in the returned map. If multiple Row objects are included in the same list, the stored sequence follows the Container type and the definition of the sub-interface of the corresponding Container. If not a single Row corresponding to the specified Container exists, the list of corresponding Row objects is blank.

        When a returned map or list included in a map is updated, whether an exception will occur or not when UnsupportedOperationException, etc. is executed is still not defined.

        Like other Container or Row operations, consistency between Containers is not guaranteed. Therefore, the processing results for a certain Container may be affected by other operation commands that have been completed prior to the start of the process.

        Like Container.get(Object, boolean) or Query.fetch(boolean), a transaction cannot be maintained and requests for updating locks cannot be made.

        If the system tries to acquire a large number of Rows all at once, the upper limit of the communication buffer size managed by the GridDB node may be reached, possibly resulting in a failure. Refer to "System limiting values" in the GridDB API Reference for the upper limit size.

        Parameters:
        containerPredicateMap - Map made up of targeted Container names and conditions
        Returns:
        Map that maintains Row groups conforming to the conditions by Container
        Throws:
        GSException - If the subject Container does not exist. If acquisition conditions concerning a specified Container that cannot be evaluated are specified
        GSException - If this process or transaction times out, a connection failure were to occur, or if it is invoked after being closed
        java.lang.NullPointerException - If null is specified as an argument containerRowsPredicate, if null is included as a key or value of this map
        See Also:
        Container.get(Object), Query.fetch(), RowKeyPredicate
      • multiPut

        void multiPut(java.util.Map<java.lang.String,java.util.List<Row>> containerRowsMap)
                      throws GSException
        New creation or update operation is carried out on an arbitrary number of rows of a Container, with the request unit enlarged as much as possible.

        For each Row object included in a specified map, a new creation or update operation is carried out just like the case when Container.put(Object) is invoked individually. However, unlike the case when carried out individually, the target node is requested for the same storage destination, etc. with a unit that is as large as possible. Based on this, the larger the total number of Row objects specified and the larger the total number of target Containers, the higher is the possibility that the number of correspondences with the target node will be reduced.

        A specified map is composed of an arbitrary number of entries that adopt the Container name as its key and list of Row objects as its value. A subject Container may be a mixture of different Container types and column layouts. However, the Containers must already exist. The Container cannot include null as a key or value of the map.

        An arbitrary number of Row with the same column layout as the subject Container can be included in each list of Row objects. In the current version, all the column sequences must also be the same. The Container cannot include null as a component of the list.

        Depending on the Container type and setting, the same restrictions as Container.put(Object) are established for the contents of Rows that can be operated. Refer to the sub-interface definition of Container for the specific restrictions.

        If there are multiple Row objects having the same Row key targeting the same Container in the designated map, the contents of the rear-most Row object having a Row key with the same value will be reflected using the take-out sequence from the iterator of the map entry group as a reference if it is between different lists, or the component sequence of the list as a reference if it is within the same list.

        The transaction cannot be maintained and the lock cannot continue to be retained. However, if the lock that affects the target Row is secured by an existing transaction, the system will continue to wait for all the locks to be released.

        Like other Container or Row operations, consistency between Containers is not guaranteed. Therefore, the processing results for a certain Container may be affected by other operation commands that have been completed prior to the start of the process.

        If an exclusion occurs in the midst of processing a Container and its Rows, only the results for some of the Rows of some of the Containers may remain reflected.

        Parameters:
        containerRowsMap - A map made up of a list of Row objects and target Container names
        Throws:
        GSException - If the target Container does not exist, or if the column layouts of the target Container and Row object do not match
        GSException - When an operation violating the restrictions unique to a specific Container type is carried out
        GSException - If this process or transaction times out, a connection failure were to occur, or if it is invoked after being closed, or if a value outside the supported range is included in the Row object
        java.lang.NullPointerException - If null is specified as an argument containerRowsMap, if null is included as a key or value of this map, or if null is included as a component of the list constituting the map
        See Also:
        Container.put(Object)
      • putCollection

        <K,R> Collection<K,R> putCollection(java.lang.String name,
                                          java.lang.Class<R> rowType)
                                      throws GSException
        Newly creates or update a Collection.

        If a Container with the specified name does not exist, it newly creates a Collection based on the Column layout defined by the specified class. If a Container with the specified name already exists and its whole Column layout matches the specified type, it behaves in the same way as getCollection(String, Class), except that it waits for active transactions to complete.

        For the correspondence between a specified type and a Column layout, see the description of Container

        If a Collection with the specified name exists and if a transaction(s) is active in the Collection, it does the operation after waiting for the transaction(s) to complete.

        Parameters:
        name - Name of a Collection subject to processing
        rowType - Type of Row object corresponding to the column layout of the Collection subject to processing
        Returns:
        A Collection object created or updated
        Throws:
        GSException - if a Collection with the specified name exists; or if the Column layout and additional settings conflict with the specified type with regard to the existing TimeSeries with the specified name.
        GSException - if a timeout occurs during this operation or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - a null parameter(s) is specified.
      • putCollection

        <K,R> Collection<K,R> putCollection(java.lang.String name,
                                          java.lang.Class<R> rowType,
                                          boolean modifiable)
                                      throws GSException
        Newly creates or update a Collection with the specified option.

        If a Container with the specified name does not exist, it newly creates a Collection based on the Column layout defined by the specified class. If a Collection with the specified name already exists and its whole Column layout matches the specified type, it behaves in the same way as getCollection(String, Class), except that it waits for active transactions to complete.

        If modifiable is true and a Collection with the specified name exists, it changes its layout as necessary. When changing the layout, it leaves unchanged the existing Columns with the same name and type as defined by the specified class. If a Column name defined by the class is not found in the existing Collection, it creates a Column with the name; and it deletes other Columns in the existing Collection as well as their data. It fails if a Column with the same name but of a different type exists. It is not possible to create or delete a Column corresponding to a Row key.

        If a trigger is set in a Container, and if a column whose trigger is subject to notification is deleted due to a change in the column layout, the column will be deleted from the list of triggers subject to notification.

        The values of Columns to be newly created are initialized according to the type as follows:

        Column typeInitial value
        STRING""(a string of length 0)
        BOOL(false)
        Numeric type0
        TIMESTAMP1970-01-01T00:00:00Z
        BLOBBLOB data of length 0
        Array typeAn array with no element

        For the correspondence between a specified type and a Column layout, see the description of Container

        If a Collection with the specified name exists and if a transaction(s) is active in the Collection, it does the operation after waiting for the transaction(s) to complete.

        When creating a Collection with Row key, an index of default type of the Row key which is defined by Container.createIndex(String) is created. The index is removable.

        Parameters:
        name - Name of a Collection subject to processing
        rowType - Type of Row object corresponding to the column layout of the Collection subject to processing
        modifiable - Indicates whether the column layout of the existing Collection can be changed or not
        Returns:
        A Collection object created or updated
        Throws:
        GSException - if a TimeSeries with the same name exists; or if modifiable is false and the Column layout of the existing Collection with the specified name conflicts with the requested layout; or if modifiable is true and it attempted to change the unchangeable items in the existing Collection with the specified name.
        GSException - if the specified type is not proper as a type of a Row object. For more information, see the description of Container.
        GSException - if a timeout occurs during this operation or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if a null parameter(s) is specified.
      • putContainer

        <K,R> Container<K,R> putContainer(java.lang.String name,
                                        java.lang.Class<R> rowType,
                                        ContainerInfo info,
                                        boolean modifiable)
                                    throws GSException
        Specify the Row object type and ContainerInfo and create a new Container or update a Container.

        Mainly used when specifying the type of Row object and creating a new Container with additional settings.

        Same as putContainer(String, ContainerInfo, boolean) if points for which the ignore setting of the column layout and column sequence cannot be specified are excluded.

        Parameters:
        name - Name of a Container subject to processing
        rowType - Type of Row object corresponding to the column layout of the Collection subject to processing
        info - Information of a Container subject to processing. Ignored if null is specified
        modifiable - To permit a change in the column layout of existing Container data or not
        Returns:
        Corresponding Container. If ContainerType.COLLECTION is specified as the Container type, the instance created will be a Collection instance. If ContainerType.TIME_SERIES is specified, the instance created will be a TimeSeries instance.
        Throws:
        GSException - If the contents of the arguments name and info do not conform to the rules. If the contents also do not conform to the rules of the new Container creation and update method for the specified Container type
        GSException - If the specified type is not suitable as the Row object type. Refer to the definition of Container for details.
        GSException - If this process times out, a connection failure were to occur, or if it is invoked after being closed
        java.lang.NullPointerException - If this process times out, a connection failure were to occur, or if it is invoked after being closed
        See Also:
        putContainer(String, ContainerInfo, boolean), putCollection(String, Class, boolean), putTimeSeries(String, Class, TimeSeriesProperties, boolean)
      • putContainer

        <K> Container<K,Row> putContainer(java.lang.String name,
                                        ContainerInfo info,
                                        boolean modifiable)
                                      throws GSException
        Specify ContainerInfo and create a new Container or update a Container.

        Excluding the next point, the behavior will be the same as putCollection(String, Class, boolean) or putTimeSeries(String, Class, TimeSeriesProperties, boolean).

        • Use ContainerInfo to specify the Container type, column layout, as well as the TimeSeries composition option where necessary
        • The Row object type of the Container returned will always be Row
        Arguments modifiable with the same respective name are used in the same way as well.

        A list of the methods to specify Container-related information is given below.

        column layout
        itemargumentdescription
        Container namename or info Specify a value that is not null in at least one of the arguments. A different value must be specified when specifying both sides.
        Container typeinfo Specify a value that is not null. If ContainerType.COLLECTION is specified, the behavior will be the same as putCollection(String, Class, boolean). If ContainerType.TIME_SERIES is specified, the behavior will be the same as putTimeSeries(String, Class, TimeSeriesProperties, boolean).
        info Set the ColumnInfo list and whether there is any Row key so as to conform to the restrictions stipulated in Container.
        ignore column sequenceinfo If ignored, no verification of the conformance with the column sequence of existing Containers with the same name will be carried out.
        TimeSeries composition optioninfo A value that is not null can be specified only if the Container type is ContainerType.TIME_SERIES.
        index settinginfo Ignored in the current version. In future versions, if settings that do not conform to the rules of Container.createIndex(String, IndexType) are included, an exception may be sent out.
        trigger settinginfo Ignored in the current version. In future versions, if settings that do not conform to the rules of Container.createTrigger(TriggerInfo) are included, an exception may be sent out.
        Container similarityinfo The specified contents will be reflected if a setting other than null is specified and newly created. The settings of an existing Container cannot be changed. The settings are ignored if null is specified.

        Parameters:
        name - Name of a Container subject to processing
        info - Information of a Container subject to processing
        modifiable - To permit a change in the column layout of existing Container data or not
        Returns:
        Corresponding Container. If ContainerType.COLLECTION is specified as the Container type, the instance created will be a Collection instance. If ContainerType.TIME_SERIES is specified, the instance created will be a TimeSeries instance.
        Throws:
        GSException - If the contents of the arguments name and info do not conform to the rules. If the contents also do not conform to the rules of the new Container creation and update method for the specified Container type
        GSException - If this process times out, a connection failure were to occur, or if it is invoked after being closed
        java.lang.NullPointerException - If null is specified in the argument info
        See Also:
        putCollection(String, Class, boolean), putTimeSeries(String, Class, TimeSeriesProperties, boolean), Container
      • putTimeSeries

        <R> TimeSeries<R> putTimeSeries(java.lang.String name,
                                      java.lang.Class<R> rowType)
                                    throws GSException
        Newly creates or updates a TimeSeries.

        If a Container with the specified name does not exist, it newly creates a TimeSeries based on the Column layout defined by the specified class. If a TimeSeries with the specified name already exists and its whole Column layout matches the specified type, it behaves in the same way as getTimeSeries(String, Class), except that it waits for active transactions to complete.

        For the correspondence between a specified type and a Column layout, see the description of Container.

        If a TimeSeries with the specified name exists and if a transaction(s) is active in the TimeSeries, it does the operation after waiting for the transaction(s) to complete.

        Parameters:
        name - Name of TimeSeries subject to processing
        rowType - Type of Row object corresponding to the column layout of the TimeSeries subject to processing
        Returns:
        A TimeSeries object created or updated
        Throws:
        GSException - if a Collection with the same name exists; or if the Column layout and additional settings conflict with the specified type with regard to the existing TimeSeries with the specified name.
        GSException - if the specified type is not proper as a type of a Row object. For more information, see the description of Container.
        GSException - if a timeout occurs during this operation or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if a null parameter(s) is specified.
      • putTimeSeries

        <R> TimeSeries<R> putTimeSeries(java.lang.String name,
                                      java.lang.Class<R> rowType,
                                      TimeSeriesProperties props,
                                      boolean modifiable)
                                    throws GSException
        Newly creates or updates a TimeSeries with the specified additional settings and update option.

        If a Container with the specified name does not exist, it newly creates a TimeSeries based on the Column layout and additional settings defined by the specified class. If a TimeSeries with the specified name already exists and its whole Column layout and additional settings match the specified type, it behaves in the same way as getTimeSeries(String, Class), except that it waits for active transactions to complete.

        If modifiable is true and a TimeSeries with the specified name exists, it changes its layout as necessary. When changing the layout, it leaves unchanged the existing Columns with the same name and type as defined by the specified class. If a Column name defined by the class is not found in the existing TimeSeries, it creates a Column with the name; and it deletes other Columns in the existing Collection as well as their data. It fails if a Column with the same name but of a different type exists. It is not possible to create or delete a Column corresponding to a Row key or change the options for configuring a TimeSeries. When specifying some options for configuring a TimeSeries, specified values must be the same as the current settings.

        If a trigger is set in a Container, and if a column whose trigger is subject to notification is deleted due to a change in the column layout, the column will be deleted from the list of triggers subject to notification.

        For the initial values for newly created Columns, see the description of putCollection(String, Class, boolean).

        For the correspondence between a specified type and a Column layout, see the description of Container

        If a TimeSeries with the specified name exists and if a transaction(s) is active in the TimeSeries, it does the operation after waiting for the transaction(s) to complete.

        Parameters:
        name - Name of TimeSeries subject to processing
        rowType - Type of Row object corresponding to the column layout of the TimeSeries subject to processing
        props - Composition option of TimeSeries. If null is specified, the existing settings will be inherited if a TimeSeries with the same name exists. If not, they will be deemed as specified in the initial status of TimeSeriesProperties.
        modifiable - To permit a change in the column layout of an existing TimeSeries or not
        Returns:
        A TimeSeries object to created or deleted
        Throws:
        GSException - if a Collection with the same name exists; or if modifiable is false and the Column layout and additional settings conflict with the specified type with regard to the existing TimeSeries with the specified name; or if modifiable is true and it attempted to change the unchangeable items in the existing TimeSeries with the specified name.
        GSException - if the specified type is not proper as a type of a Row object. For more information, see the description of Container.
        GSException - if a timeout occurs during this operation or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if a null parameter(s) is specified.

Class GridStoreFactory

  • java.lang.Object
    • com.toshiba.mwcloud.gs.GridStoreFactory
  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable


    public abstract class GridStoreFactory
    extends java.lang.Object
    implements java.io.Closeable
    Manages a GridStore instance.

    It manages the client settings shared by GridStore instances and used connections.

    To access GridDB, you need to get a GridStore instance using this Factory.

    All the public methods of this class are thread safe.

    Client Logging and Client Properties File are available.

    Client Logging

    Logging is enabled by adding the logging library SLF4J to the classpath.

    The name of the logger begins with "com.toshiba.mwcloud.gs.GridStoreLogger". The recommended version of SLF4J is 1.6.0 or above.

    Client Properties File

    By including both of the directory including the properties file "gs_client.properties" and the configuration library "gridstore-conf.jar" in the classpath, properties of the file are applied to GridStoreFactory. Connection properties can be changed without editing application codes by using the properties file. The priority of applying the properties of the file is higher than the properties of Properties object. The following properties are available for the Client Properties File.

    Factory Category Property
    Properties conform to setProperties(Properties) specifications are available.
    Add "factory." before each property name as following.
    factory.maxConnectionPoolSize = 10
    Store Category Property
    Properties conform to getGridStore(Properties) specifications are available.
    Add "store." before each property name as following.
    store.clusterName = Project1

    Exceptions will be thrown in the cases as following.

    • If two or more directories of the properties files are included in the classpath
    • If only the configuration library is included in the classpath
    • If an unavailable property name is specified
    • If a specified property name is made up of only the category name

    By including only the directory including the properties file, properties of the file are not applied to GridStoreFactory.

    • Constructor Summary

      Constructors 
      Modifier Constructor and Description
      protected GridStoreFactory() 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      abstract void close()
      Closes all GridStore instances created by this Factory and release related resources as necessary.
      abstract GridStore getGridStore(java.util.Properties properties)
      Returns a GridStore with the specified properties.
      static GridStoreFactory getInstance()
      Returns a default instance.
      abstract void setProperties(java.util.Properties properties)
      Changes the settings for this Factory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GridStoreFactory

        protected GridStoreFactory()
    • Method Detail

      • close

        public abstract void close()
                            throws GSException
        Closes all GridStore instances created by this Factory and release related resources as necessary.

        Even if GSException is thrown, all related connection resources are released. If the connection is already closed, this method will not work effectively. It is also called when stopping the current VM.

        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        GSException - if an connection failure etc. occurs while closing.
        See Also:
        Closeable.close()
      • getGridStore

        public abstract GridStore getGridStore(java.util.Properties properties)
                                        throws GSException
        Returns a GridStore with the specified properties.

        When obtaining GridStore, it just searches for the name of a master node (hereafter, a master) administering each Container as necessary, but authentication is not performed. When a client really needs to connect to a node corresponding to each Container, authentication is performed.

        The following properties can be specified. Unsupported property names are ignored. See "System limiting values" in the GridDB API Reference for upper limit values of some properties.

        PropertyDescription
        hostA destination host name. An IP address (IPV4 only) is also available. Mandatory for manually setting a master. For autodetection of a master, omit the setting.
        portA destination port number. A string representing of a number from 0 to 65535. Mandatory for manually setting a master. For autodetection of a master, omit the setting.
        notificationAddressAn IP address (IPV4 only) for receiving a notification used for autodetection of a master. A default address is used if omitted.
        notificationPortA port number for receiving a notification used for autodetection of a master. A string representing of a number from 0 to 65535. A default port number is used if omitted.
        clusterNameA cluster name. It is used to verify whether it matches the cluster name assigned to the destination cluster. If it is omitted or an empty string is specified, cluster name verification is not performed. If a cluster name of over the upper length limit is specified, connection to the cluster node will fail.
        userA user name
        passwordA password for user authentication
        consistencyEither one of the following consistency levels:
        "IMMEDIATE"
        The updates by other clients are committed immediately after a relevant transaction completes.
        "EVENTUAL"
        The updates by other clients may not be committed even after a relevant transaction completes. No update operation cannot be applied to Container.
        By default, "IMMEDIATE" is selected.
        transactionTimeoutThe minimum value of transaction timeout time. The transaction timeout is counted from the beginning of each transaction in a relevant Container. A string representing of a number from 0 to Integer.MAX_VALUE in seconds. The value 0 indicates that it is always uncertain whether a timeout error will occur during a subsequent transaction. If a value specified over the internal upper limit of timeout, timeout will occur at the internal upper limit value. If omitted, the default value used by a destination GridDB is applied.
        failoverTimeoutThe minimum value of waiting time until a new destination is found in a failover. A numeric string representing from 0 to Integer.MAX_VALUE in seconds. The value 0 indicates that no failover is performed. If omitted, the default value used by this Factory is applied.
        containerCacheSizeThe maximum number of ContainerInfos on the Container cache. A string representing of a number from 0 to Integer.MAX_VALUE. The Container cache is not used if the value is 0. To obtain a Container, its ContainerInfo might be obtained from the Container cache instead of request to GridDB. A default number is used if omitted.
        dataAffinityPatternPatterns of Container names and data affinity strings in order to set data affinity strings to their Containers automatically. Format is as following.
        (ContainerNamePattern1)=(DataAffinityString1),(ContainerNamePattern2)=(DataAffinityString2),...
        The dataAffinityPattern is applied to the new Container when it is created with the ContainerInfo which does not include a data affinity string. If a Container name matches one of the ContainerNamePattern of the dataAffinityPattern, the corresponding data affinity string is applied to the new Container. The priority order of matching and applying patterns is the order of specified patterns. ContainerNamePatterns maintain the general contract for Container names, except a wild card character "%" is also acceptable additionally. Data affinity patterns maintain the general contract for ContainerInfo.setDataAffinity(String).

        A new GridStore instance is created by each call of this method. Operations on different GridStore instances and related objects are thread safe. That is, if some two objects are each created based on GridStore instances or they are just GridStore instances, and if they are related to different GridStore instances respectively, any method of one object can be called, no matter when a method of the other object may be called from any thread. However, since thread safety is not guaranteed for GridStore itself, it is not allowed to call a method of a single GridStore instance from two or more threads at an arbitrary time.

        Parameters:
        properties - Properties specifying the settings for the object to be obtained.
        Throws:
        GSException - if host name resolution fails.
        GSException - if any specified property does not match the format shown above. If the properties match the format, no GSException is thrown even if connection or authentication will not succeed with their values.
        GSException - if the connection is closed.
        java.lang.NullPointerException - null is specified as properties.
      • getInstance

        public static GridStoreFactory getInstance()
        Returns a default instance.

        When loading this class, a default subclass of the GridStoreFactory class is loaded and an instance is created.

      • setProperties

        public abstract void setProperties(java.util.Properties properties)
                                    throws GSException
        Changes the settings for this Factory.

        The changed settings are reflected in GridStore already created by this Factory and GridStore to be created by this Factory later.

        The following properties can be specified. Unsupported property names are ignored.

        PropertyDescription
        maxConnectionPoolSizeThe maximum number of connections in the connection pool used inside. A numeric string representing 0 to Integer.MAX_VALUE. The value 0 indicates no use of the connection pool. If omitted, the default value is used.
        failoverTimeoutThe minimum value of waiting time until a new destination is found in a failover. A numeric string representing 0 to Integer.MAX_VALUE in seconds. The value 0 indicates that no failover is performed. If omitted, the default value is used.

        Throws:
        GSException - if any specified property does not match the format shown above.
        GSException - if the connection is closed.
        java.lang.NullPointerException - null is specified as properties.

Enum IndexType

  • java.lang.Object
    • java.lang.Enum<IndexType>
      • com.toshiba.mwcloud.gs.IndexType
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<IndexType>


    public enum IndexType
    extends java.lang.Enum<IndexType>
    Represents the type(s) of indexes set on a Container.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      HASH
      Indicates a hash index.
      SPATIAL
      Not supported
      TREE
      Indicates a tree index.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static IndexType valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static IndexType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • HASH

        public static final IndexType HASH
        Indicates a hash index.

        This type of index can be set on the following types of Columns in Collection

        • STRING
        • BOOL
        • BYTE
        • SHORT
        • INTEGER
        • LONG
        • FLOAT
        • DOUBLE
        • TIMESTAMP
        It cannot be set on Columns in TimeSeries.

      • SPATIAL

        public static final IndexType SPATIAL
        Not supported
      • TREE

        public static final IndexType TREE
        Indicates a tree index.

        This index can be applied to following types of Columns of any type of Container, except the Column corresponding to the Row key of TimeSeries.

        • STRING
        • BOOL
        • BYTE
        • SHORT
        • INTEGER
        • LONG
        • FLOAT
        • DOUBLE
        • TIMESTAMP

    • Method Detail

      • valueOf

        public static IndexType valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static IndexType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (IndexType c : IndexType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Enum InterpolationMode

  • java.lang.Object
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<InterpolationMode>


    public enum InterpolationMode
    extends java.lang.Enum<InterpolationMode>
    Represents the type of interpolation of Rows.

    It is used by the function of interpolating TimeSeries Rows.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      EMPTY
      Indicates using an empty value as an interpolated value.
      LINEAR_OR_PREVIOUS
      Indicates performing linear interpolation or interpolation with the value of a privious Row on Columns.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static InterpolationMode valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static InterpolationMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • EMPTY

        public static final InterpolationMode EMPTY
        Indicates using an empty value as an interpolated value.

        It indicates that an empty value defined for each type is used as an interpolated value for all Row fields except Row keys. The empty value is the same as the initial value of a Column newly created when changing a Column layout using GridStore.putCollection(String, Class, boolean).

      • LINEAR_OR_PREVIOUS

        public static final InterpolationMode LINEAR_OR_PREVIOUS
        Indicates performing linear interpolation or interpolation with the value of a privious Row on Columns.

        The Column specified the interpolation function is linearly interpolated with the Row values before and after the target time of interpolation. The target Column must be of numeric type.

        The Columns not specified as interpolation targets are interpolated with adjacent Row values just before the target time of interpolation. Those Columns can be of any type.

    • Method Detail

      • valueOf

        public static InterpolationMode valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static InterpolationMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (InterpolationMode c : InterpolationMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Interface PartitionController

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable


    public interface PartitionController
    extends java.io.Closeable
    Controller for acquiring and processing the partition status.

    A partition is a theoretical region where data is stored. It is used to perform operations based on the data arrangement in a GridDB cluster.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void assignPreferableHost(int partitionIndex, java.net.InetAddress host)
      Set the address of the host to be prioritized in the selection.
      void close()
      The connection status with GridDB is released and related resources are released where necessary.
      java.util.List<java.net.InetAddress> getBackupHosts(int partitionIndex)
      Get a list of the addresses of the backup nodes corresponding to a specified partition.
      long getContainerCount(int partitionIndex)
      Get the total number of containers belonging to a specified partition.
      java.util.List<java.lang.String> getContainerNames(int partitionIndex, long start, java.lang.Long limit)
      Get a list of the Container names belonging to a specified partition.
      java.util.List<java.net.InetAddress> getHosts(int partitionIndex)
      Get a list of the addresses of the nodes corresponding to a specified partition.
      java.net.InetAddress getOwnerHost(int partitionIndex)
      Get the address of the owner node corresponding to a specified partition.
      int getPartitionCount()
      Get the number of partitions in the target GridDB cluster.
      int getPartitionIndexOfContainer(java.lang.String containerName)
      Get the partition index corresponding to the specified Container name.
    • Method Detail

      • assignPreferableHost

        void assignPreferableHost(int partitionIndex,
                                java.net.InetAddress host)
                                  throws GSException
        Set the address of the host to be prioritized in the selection.

        If multiple possible destinations exist e.g. connections to backup nodes, etc., the address set will always be selected if it is included in the candidate destination. The setting is ignored otherwise.

        Parameters:
        partitionIndex - Partition index. A value of 0 or above and less than the number of partitions.
        host - Address of the host to be prioritized in the selection. For null, the setting is cancelled
        Throws:
        GSException - If a partition index outside the range is specified
        GSException - If invoked after this object or corresponding GridStore is closed.
        See Also:
        getBackupHosts(int)
      • close

        void close()
                   throws GSException
        The connection status with GridDB is released and related resources are released where necessary.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        GSException - Not sent out in the current version
      • getBackupHosts

        java.util.List<java.net.InetAddress> getBackupHosts(int partitionIndex)
                                                            throws GSException
        Get a list of the addresses of the backup nodes corresponding to a specified partition.

        A backup node is a node that is selected with a higher priority when "EVENTUAL" is specified as a consistency level in GridStoreFactory.getGridStore(java.util.Properties).

        The list will be compiled in no particular order. No duplicate address will be included.

        When a returned list is updated, whether an exception will occur or not when UnsupportedOperationException, etc. is executed is still not defined.

        Parameters:
        partitionIndex - Partition index. A value of 0 or above and less than the number of partitions.
        Returns:
        Assuming InetAddress, which represents the address of the backup node, as a component, List
        Throws:
        GSException - If a partition index outside the range is specified
        GSException - If this process times out, when a connection error occurs, or if the process is invoked after this object or corresponding GridStore is closed
      • getContainerCount

        long getContainerCount(int partitionIndex)
                               throws GSException
        Get the total number of containers belonging to a specified partition.

        The calculated quantity when determining the number of containers is generally not dependent on the number of containers.

        Parameters:
        partitionIndex - Partition index. A value of 0 or above and less than the number of partitions.
        Returns:
        Number of containers
        Throws:
        GSException - If a partition index outside the range is specified
        GSException - If this process times out, when a connection error occurs, or if the process is invoked after this object or corresponding GridStore is closed
        See Also:
        getPartitionIndexOfContainer(String)
      • getContainerNames

        java.util.List<java.lang.String> getContainerNames(int partitionIndex,
                                                         long start,
                                                         java.lang.Long limit)
                                                           throws GSException
        Get a list of the Container names belonging to a specified partition.

        For the specified partition, the sequence of the list of acquisition results before and after will not be changed when the relevant Container is excluded even if a Container is newly created, its composition changed or the Container is deleted. All other lists are compiled in no particular order. No duplicate names will be included.

        If the upper limit of the number of acquisition cases is specified, the cases will be cut off starting from the ones at the back if the upper limit is exceeded. If no relevant specified condition exists, a blank list is returned.

        When a returned list is updated, whether an exception will occur or not when UnsupportedOperationException, etc. is executed is still not defined.

        Parameters:
        partitionIndex - Partition index. A value of 0 or above and less than the number of partitions.
        start - Start position of the acquisition range. A value of 0 and above
        limit - Upper limit of the number of cases acquired. If null, no upper limit is assumed
        Returns:
        Assuming the Container name as a component List
        Throws:
        GSException - If a partition index outside the range is specified
        GSException - If this process times out, when a connection error occurs, or if the process is invoked after this object or corresponding GridStore is closed
      • getHosts

        java.util.List<java.net.InetAddress> getHosts(int partitionIndex)
                                                      throws GSException
        Get a list of the addresses of the nodes corresponding to a specified partition.

        The list will be compiled in no particular order. No duplicate address will be included.

        When a returned list is updated, whether an exception will occur or not when UnsupportedOperationException, etc. is executed is still not defined.

        Parameters:
        partitionIndex - Partition index. A value of 0 or above and less than the number of partitions.
        Returns:
        Assuming InetAddress, which represents the address of the node, as a component, List
        Throws:
        GSException - If a partition index outside the range is specified
        GSException - If this process times out, when a connection error occurs, or if the process is invoked after this object or corresponding GridStore is closed
      • getOwnerHost

        java.net.InetAddress getOwnerHost(int partitionIndex)
                                          throws GSException
        Get the address of the owner node corresponding to a specified partition.

        An owner node is a node that is always selected when "IMMEDIATE" is specified as a consistency level in GridStoreFactory.getGridStore(java.util.Properties).

        Parameters:
        partitionIndex - Partition index. A value of 0 or above and less than the number of partitions.
        Returns:
        Represents the address of the owner node InetAddress
        Throws:
        GSException - If a partition index outside the range is specified
        GSException - If this process times out, when a connection error occurs, or if the process is invoked after this object or corresponding GridStore is closed
      • getPartitionCount

        int getPartitionCount()
                              throws GSException
        Get the number of partitions in the target GridDB cluster.

        Get the value of the number of partitions set in the target GridDB cluster. Results are cached once acquired and until the next cluster failure and cluster node failure is detected, no inquiry will be sent to the GridDB cluster again.

        Returns:
        Number of partitions
        Throws:
        GSException - If this process times out or when a connection error occurs, or if the process is invoked after this object or corresponding GridStore is closed
      • getPartitionIndexOfContainer

        int getPartitionIndexOfContainer(java.lang.String containerName)
                                         throws GSException
        Get the partition index corresponding to the specified Container name.

        Once a GridDB cluster is constructed, there will not be any changes in the partitions of the destination that the Container belongs to and the partition index will also be fixed. Whether there is a Container corresponding to the specified name or not does not depend on the results

        Information required in the computation of the partition index is cached and until the next cluster failure and cluster node failure is detected, no inquiry will be sent to the GridDB cluster again.

        Parameters:
        containerName - Container name. null cannot be specified
        Returns:
        Partition index corresponding to the specified Container name
        Throws:
        GSException - If a character string allowed as a Container name is specified
        GSException - If this process times out, when a connection error occurs, or if the process is invoked after this object or corresponding GridStore is closed
        java.lang.NullPointerException - If null is specified in the argument

Interface Query<R>

  • Type Parameters:
    R - the type of RowSet elements to be obtained
    All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable


    public interface Query<R>
    extends java.io.Closeable
    Provides the functions of holding the information about a query related to a specific Container, specifying the options for fetching and retrieving the result.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void close()
      Releases related resources properly.
      RowSet<R> fetch()
      Executes a query and returns a set of Rows as an execution result.
      RowSet<R> fetch(boolean forUpdate)
      Executes a query with the specified option and returns a set of Rows as an execution result.
      RowSet<R> getRowSet()
      Returns RowSet of the latest result.
      void setFetchOption(FetchOption option, java.lang.Object value)
      Sets an option for a result set.
    • Method Detail

      • close

        void close()
                   throws GSException
        Releases related resources properly.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        GSException - not be thrown in the current version.
        See Also:
        Closeable.close()
      • fetch

        RowSet<R> fetch()
                        throws GSException
        Executes a query and returns a set of Rows as an execution result.

        It behaves in the same way as fetch(boolean) is called without requesting a lock for update.

        Throws:
        GSException - if the target query contains any wrong parameter, syntax, or directive. For example, in the case of TQL, if the type of a specified Column does not match the parameter of a function. For detailed restrictions, see the descriptions of the functions to create a query.
        GSException - if the requested type of RowSet elements does not match the type of the result set in executing a TQL query.
        GSException - if a timeout occurs during this operation or its related transaction, the relevant Container is deleted, its schema is changed or a connection failure occurs.
        GSException - if called after this object or the relevant Container is closed.
        java.lang.NullPointerException - if an unsupported null parameter is specified when creating this query. It will not be thrown as a result of evaluating a TQL statement in GridDB.
        See Also:
        fetch(boolean)
      • fetch

        RowSet<R> fetch(boolean forUpdate)
                        throws GSException
        Executes a query with the specified option and returns a set of Rows as an execution result.

        It locks all target Rows if true is specified as forUpdate. If the target Rows are locked, update operations on the Rows by any other transactions are blocked while a relevant transaction is active. TRUE can be specified only if the autocommit mode is disabled on a relevant Container.

        If it is called to obtain new Rows, RowSet of the last result of this query will be closed.

        It will be failed if too much Rows are obtained, because of the data buffer size upper limit of GridDB node. See "System limiting values" in the GridDB API Reference about the buffer size upper limit.

        Throws:
        GSException - if true is specified as forUpdate although the autocommit mode is enabled on a relevant Container.
        GSException - if true is specified as forUpdate for a query which cannot acquire a lock. For the availability of a lock, see the descriptions of the functions to create a query.
        GSException - if the target query contains any wrong parameter, syntax, or directive. For example, in the case of TQL, if the type of a specified Column does not match the parameter of a function. For detailed restrictions, see the descriptions of the functions to create a query.
        GSException - if the requested type of RowSet elements does not match the type of the result set in executing a TQL query.
        GSException - if a timeout occurs during this operation or its related transaction, the relevant Container is deleted, its schema is changed or a connection failure occurs.
        GSException - if called after this object or the relevant Container is closed.
        java.lang.NullPointerException - if an unsupported null parameter is specified when creating this query.
      • getRowSet

        RowSet<R> getRowSet()
                            throws GSException
        Returns RowSet of the latest result.

        After RowSet returned once, it returns null until the new query is executed.

        Returns:
        RowSet of the latest result at the first time, or null from the second time or no query executed before.
        Throws:
        GSException - if called after this object or the relevant Container is closed.
      • setFetchOption

        void setFetchOption(FetchOption option,
                          java.lang.Object value)
                            throws GSException
        Sets an option for a result set.

        See FetchOption for the definitions of supported option items and values.

        Parameters:
        option - an option item
        value - an option value
        Throws:
        GSException - if the specified option value is invalid for the specified option item.
        GSException - if called after this object or the relevant Container is closed.
        java.lang.NullPointerException - if a null parameter(s) is specified.
        See Also:
        FetchOption

Class QueryAnalysisEntry

  • java.lang.Object
    • com.toshiba.mwcloud.gs.QueryAnalysisEntry


  • public class QueryAnalysisEntry
    extends java.lang.Object
    Represents one of information entries composing a query plan and the results of analyzing a query operation.

    It is used to hold the result of executing an EXPLAIN statement or an EXPLAIN ANALYZE statement in TQL. One execution result is represented by an array of entries.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj)
      Indicates whether some other object is "equal to" this one.
      int getDepth()
      Returns the depth indicating the relation to other entries.
      int getId()
      Returns the ID indicating the location of an entry in an array of entries.
      java.lang.String getStatement()
      Returns a part of a TQL statement corresponding to the information indicated by an entry.
      java.lang.String getType()
      Returns the type of the information indicated by an entry.
      java.lang.String getValue()
      Returns a character string representing the value of the information indicated by an entry.
      java.lang.String getValueType()
      Returns the value type of the information indicated by an entry.
      int hashCode()
      Returns hash code of this object.
      void setDepth(int depth)
      Sets the depth indicating the relation to other entries.
      void setId(int id)
      Sets the ID indicating the location of an entry in an array of entries.
      void setStatement(java.lang.String statement)
      Sets a part of a TQL statement corresponding to the information indicated by an entry.
      void setType(java.lang.String type)
      Sets the type of the information indicated by an entry.
      void setValue(java.lang.String value)
      Sets a character string representing the value of the information indicated by an entry.
      void setValueType(java.lang.String valueType)
      Sets the value type of the information indicated by an entry.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QueryAnalysisEntry

        public QueryAnalysisEntry()
    • Method Detail

      • equals

        public boolean equals(java.lang.Object obj)
        Indicates whether some other object is "equal to" this one.

        Returns true if each values (e.g. valuse returned by getId() or getDepth()) of this object and the specified object are equivalent.

        This method maintain the general contract for the Object.hashCode() method, which states that equal objects must have equal hash codes.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
        See Also:
        hashCode()
      • getDepth

        public int getDepth()
        Returns the depth indicating the relation to other entries.

        If there is found an entry whose depth is smaller than that of a target entry by one, through checking entries one by one whose IDs are smaller than that of the target entry, it means that the target entry describes the content of the found entry in more detail.

      • getId

        public int getId()
        Returns the ID indicating the location of an entry in an array of entries.

        In a result set of executing a TQL query, IDs are assigned serially starting from 1.

      • getStatement

        public java.lang.String getStatement()
        Returns a part of a TQL statement corresponding to the information indicated by an entry.

        Returns an empty string if no correspondence is found.

      • getType

        public java.lang.String getType()
        Returns the type of the information indicated by an entry.

        A returned value indicates the type of an analysis result (e.g., execution time), the type of a component of a query plan, etc.

      • getValue

        public java.lang.String getValue()
        Returns a character string representing the value of the information indicated by an entry.

        It returns an empty string if no value is assigned.

        See Also:
        getValueType()
      • getValueType

        public java.lang.String getValueType()
        Returns the value type of the information indicated by an entry.

        It returns the value type of an analysis result (e.g., execution time) etc. The following types (primitive types defined by TQL) are supported:

        • STRING
        • BOOL
        • BYTE
        • SHORT
        • INTEGER
        • LONG
        • FLOAT
        • DOUBLE

        It returns an empty string if no value is assigned.

      • hashCode

        public int hashCode()
        Returns hash code of this object.

        This method maintain the general contract for the Object.hashCode() method, which states that equal objects must have equal hash codes.

        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hash code of this object
        See Also:
        equals(Object)
      • setDepth

        public void setDepth(int depth)
        Sets the depth indicating the relation to other entries.
        See Also:
        getDepth()
      • setId

        public void setId(int id)
        Sets the ID indicating the location of an entry in an array of entries.
        See Also:
        getId()
      • setStatement

        public void setStatement(java.lang.String statement)
        Sets a part of a TQL statement corresponding to the information indicated by an entry.
        See Also:
        getStatement()
      • setType

        public void setType(java.lang.String type)
        Sets the type of the information indicated by an entry.
        See Also:
        getType()
      • setValue

        public void setValue(java.lang.String value)
        Sets a character string representing the value of the information indicated by an entry.
        See Also:
        getValue()
      • setValueType

        public void setValueType(java.lang.String valueType)
        Sets the value type of the information indicated by an entry.
        See Also:
        getValueType()

Enum QueryOrder

  • java.lang.Object
    • java.lang.Enum<QueryOrder>
      • com.toshiba.mwcloud.gs.QueryOrder
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<QueryOrder>


    public enum QueryOrder
    extends java.lang.Enum<QueryOrder>
    Represents the order of Rows requested by a query.

    It is used to specify the order of Rows targeted by each query function. Specific targets differ with individual functions.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      ASCENDING
      Indicates the requested order of Rows is an ascending order.
      DESCENDING
      Indicates the requested order of Rows is a descending order.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static QueryOrder valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static QueryOrder[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • ASCENDING

        public static final QueryOrder ASCENDING
        Indicates the requested order of Rows is an ascending order.
      • DESCENDING

        public static final QueryOrder DESCENDING
        Indicates the requested order of Rows is a descending order.
    • Method Detail

      • valueOf

        public static QueryOrder valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static QueryOrder[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (QueryOrder c : QueryOrder.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Interface Row



  • public interface Row
    A general-purpose Row for managing fields in any schema.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.sql.Blob getBlob(int column)
      Returns the Blob value of the specified field.
      boolean getBool(int column)
      Returns the boolean value of the specified field.
      boolean[] getBoolArray(int column)
      Returns the boolean array value of the specified field.
      byte getByte(int column)
      Returns the byte value of the specified field.
      byte[] getByteArray(int column)
      Returns the byte array value of the specified field.
      double getDouble(int column)
      Returns the double value of the specified field.
      double[] getDoubleArray(int column)
      Returns the double array value of the specified field.
      float getFloat(int column)
      Returns the float value of the specified field.
      float[] getFloatArray(int column)
      Returns the byte float value of the specified field.
      Geometry getGeometry(int column)
      Returns the Geometry value of the specified field.
      int getInteger(int column)
      Returns the int value of the specified field.
      int[] getIntegerArray(int column)
      Returns the int array value of the specified field.
      long getLong(int column)
      Returns the long value of the specified field.
      long[] getLongArray(int column)
      Returns the long array value of the specified field.
      ContainerInfo getSchema()
      Returns the schema corresponding to the specified Row.
      short getShort(int column)
      Returns the short value of the specified field.
      short[] getShortArray(int column)
      Returns the short array value of the specified field.
      java.lang.String getString(int column)
      Returns the String value of the specified field.
      java.lang.String[] getStringArray(int column)
      Returns the String array value of the specified field.
      java.util.Date getTimestamp(int column)
      Returns the TIMESTAMP value of the specified field.
      java.util.Date[] getTimestampArray(int column)
      Returns the TIMESTAMP array value of the specified field.
      java.lang.Object getValue(int column)
      Returns the value of the specified field.
      void setBlob(int column, java.sql.Blob fieldValue)
      Sets the Blob value to the specified field.
      void setBool(int column, boolean fieldValue)
      Sets the boolean value to the specified field.
      void setBoolArray(int column, boolean[] fieldValue)
      Sets the boolean array value to the specified field.
      void setByte(int column, byte fieldValue)
      Sets the byte value to the specified field.
      void setByteArray(int column, byte[] fieldValue)
      Sets the byte array value to the specified field.
      void setDouble(int column, double fieldValue)
      Sets the double value to the specified field.
      void setDoubleArray(int column, double[] fieldValue)
      Sets the double array value to the specified field.
      void setFloat(int column, float fieldValue)
      Sets the float value to the specified field.
      void setFloatArray(int column, float[] fieldValue)
      Sets the float array value to the specified field.
      void setGeometry(int column, Geometry fieldValue)
      Sets the Geometry value to the specified field.
      void setInteger(int column, int fieldValue)
      Sets the int value to the specified field.
      void setIntegerArray(int column, int[] fieldValue)
      Sets the int array value to the specified field.
      void setLong(int column, long fieldValue)
      Sets the long value to the specified field.
      void setLongArray(int column, long[] fieldValue)
      Sets the long array value to the specified field.
      void setShort(int column, short fieldValue)
      Sets the short value to the specified field.
      void setShortArray(int column, short[] fieldValue)
      Sets the short array value to the specified field.
      void setString(int column, java.lang.String fieldValue)
      Sets the String value to the specified field.
      void setStringArray(int column, java.lang.String[] fieldValue)
      Sets the String array value to the specified field.
      void setTimestamp(int column, java.util.Date fieldValue)
      Sets the TIMESTAMP value to the specified field.
      void setTimestampArray(int column, java.util.Date[] fieldValue)
      Sets the TIMESTAMP array value to the specified field.
      void setValue(int column, java.lang.Object fieldValue)
      Sets the value to the specified field.
    • Method Detail

      • getBlob

        java.sql.Blob getBlob(int column)
                              throws GSException
        Returns the Blob value of the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getBool

        boolean getBool(int column)
                        throws GSException
        Returns the boolean value of the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getBoolArray

        boolean[] getBoolArray(int column)
                               throws GSException
        Returns the boolean array value of the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getByte

        byte getByte(int column)
                     throws GSException
        Returns the byte value of the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getByteArray

        byte[] getByteArray(int column)
                            throws GSException
        Returns the byte array value of the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getDouble

        double getDouble(int column)
                         throws GSException
        Returns the double value of the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getDoubleArray

        double[] getDoubleArray(int column)
                                throws GSException
        Returns the double array value of the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getFloat

        float getFloat(int column)
                       throws GSException
        Returns the float value of the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getFloatArray

        float[] getFloatArray(int column)
                              throws GSException
        Returns the byte float value of the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getGeometry

        Geometry getGeometry(int column)
                             throws GSException
        Returns the Geometry value of the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getInteger

        int getInteger(int column)
                       throws GSException
        Returns the int value of the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getIntegerArray

        int[] getIntegerArray(int column)
                              throws GSException
        Returns the int array value of the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getLong

        long getLong(int column)
                     throws GSException
        Returns the long value of the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getLongArray

        long[] getLongArray(int column)
                            throws GSException
        Returns the long array value of the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getSchema

        ContainerInfo getSchema()
                                throws GSException
        Returns the schema corresponding to the specified Row.

        It returns ContainerInfo in which only the Column layout information including the existance of any RowKey is set, and the Container name, the Container type, index settings, and the TimeSeries configuration options are not included.

        Returns:
        ContainerInfo having only container information related to the schema.
        Throws:
        GSException - This will not be thrown in the current version.
      • getShort

        short getShort(int column)
                       throws GSException
        Returns the short value of the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getShortArray

        short[] getShortArray(int column)
                              throws GSException
        Returns the short array value of the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getString

        java.lang.String getString(int column)
                                   throws GSException
        Returns the String value of the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getStringArray

        java.lang.String[] getStringArray(int column)
                                          throws GSException
        Returns the String array value of the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getTimestamp

        java.util.Date getTimestamp(int column)
                                    throws GSException
        Returns the TIMESTAMP value of the specified field.

        If the contents of a specified object is changed after it has been invoked, it is not defined whether the contents of this object will be changed or not. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getTimestampArray

        java.util.Date[] getTimestampArray(int column)
                                           throws GSException
        Returns the TIMESTAMP array value of the specified field.

        If the contents of a specified object is changed after it has been invoked, it is not defined whether the contents of this content will be changed or not On the otherhand, the contents of the returned object will not be changed by operating this object.

        An effect of updates of the returned object to this object is uncertain. Moreover, after an object is returned, updating this object will not change the contents of the returned object.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • getValue

        java.lang.Object getValue(int column)
                                  throws GSException
        Returns the value of the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        Returns:
        the value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
      • setBlob

        void setBlob(int column,
                   java.sql.Blob fieldValue)
                     throws GSException
        Sets the Blob value to the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setBool

        void setBool(int column,
                   boolean fieldValue)
                     throws GSException
        Sets the boolean value to the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • setBoolArray

        void setBoolArray(int column,
                        boolean[] fieldValue)
                          throws GSException
        Sets the boolean array value to the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setByte

        void setByte(int column,
                   byte fieldValue)
                     throws GSException
        Sets the byte value to the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • setByteArray

        void setByteArray(int column,
                        byte[] fieldValue)
                          throws GSException
        Sets the byte array value to the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setDouble

        void setDouble(int column,
                     double fieldValue)
                       throws GSException
        Sets the double value to the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • setDoubleArray

        void setDoubleArray(int column,
                          double[] fieldValue)
                            throws GSException
        Sets the double array value to the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setFloat

        void setFloat(int column,
                    float fieldValue)
                      throws GSException
        Sets the float value to the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • setFloatArray

        void setFloatArray(int column,
                         float[] fieldValue)
                           throws GSException
        Sets the float array value to the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setGeometry

        void setGeometry(int column,
                       Geometry fieldValue)
                         throws GSException
        Sets the Geometry value to the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setInteger

        void setInteger(int column,
                      int fieldValue)
                        throws GSException
        Sets the int value to the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • setIntegerArray

        void setIntegerArray(int column,
                           int[] fieldValue)
                             throws GSException
        Sets the int array value to the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setLong

        void setLong(int column,
                   long fieldValue)
                     throws GSException
        Sets the long value to the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • setLongArray

        void setLongArray(int column,
                        long[] fieldValue)
                          throws GSException
        Sets the long array value to the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setShort

        void setShort(int column,
                    short fieldValue)
                      throws GSException
        Sets the short value to the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if the type of the specified field does not match the type of the Column.
      • setShortArray

        void setShortArray(int column,
                         short[] fieldValue)
                           throws GSException
        Sets the short array value to the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setString

        void setString(int column,
                     java.lang.String fieldValue)
                       throws GSException
        Sets the String value to the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setStringArray

        void setStringArray(int column,
                          java.lang.String[] fieldValue)
                            throws GSException
        Sets the String array value to the specified field.

        If the contents of a specified object is changed after it has been invoked, the contents of this object will not be changed.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value or its element.
        GSException - if the type of the specified field does not match the type of the Column.
      • setTimestamp

        void setTimestamp(int column,
                        java.util.Date fieldValue)
                          throws GSException
        Sets the TIMESTAMP value to the specified field.

        If the contents of a specified object is changed after it has been invoked, it is not defined whether the contents of this object will be changed or not.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value.
        GSException - if the type of the specified field does not match the type of the Column.
      • setTimestampArray

        void setTimestampArray(int column,
                             java.util.Date[] fieldValue)
                               throws GSException
        Sets the TIMESTAMP array value to the specified field.

        If the contents of a specified object is changed after it has been invoked, it is not defined whether the contents of this content will be changed or not.

        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value or its element.
        GSException - if the type of the specified field does not match the type of the Column.
      • setValue

        void setValue(int column,
                    java.lang.Object fieldValue)
                      throws GSException
        Sets the value to the specified field.
        Parameters:
        column - the Column number of the target field, from 0 to number of Columns minus one.
        fieldValue - value of the target field
        Throws:
        GSException - if the specified Column number is out of range.
        GSException - if null is specified as the field value or its element.
        GSException - if the type of the specified field does not match the type of the Column.

Annotation Type RowField



  • @Retention(value=RUNTIME)
    @Target(value={FIELD,METHOD})
    public @interface RowField
    Sets options for mapping Row fields of a Container.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element and Description
      int columnNumber
      Sets a Column number.
      java.lang.String name
      Sets the name to be used as a Column name.
    • Element Detail

      • columnNumber

        public abstract int columnNumber
        Sets a Column number.

        To specify the location of a Column explicitly, specify 0 or more and less than the number of Columns. Duplicate Column numbers cannot be specified in a single Container. A Row key must be always assigned to the first Column. If the default value -1 is specified, the corresponding Column number is automatically determined.

        Default:
        -1
      • name

        public abstract java.lang.String name
        Sets the name to be used as a Column name.

        If an empty string is specified, the Column name is determined based on the corresponding field name or method name.

        Default:
        ""

Annotation Type RowKey



  • @Retention(value=RUNTIME)
    @Target(value={FIELD,METHOD})
    public @interface RowKey
    Indicates the correspondence with a key of Container.

Class RowKeyPredicate<K>

  • java.lang.Object
    • com.toshiba.mwcloud.gs.RowKeyPredicate<K>
  • Type Parameters:
    K - type of RowKey


    public class RowKeyPredicate<K>
    extends java.lang.Object
    Represents the condition that a RowKey satisfies.

    This is used as the search condition in GridStore.multiGet(java.util.Map)

    There are two types of conditions, range condition and individual condition. The two types of conditions cannot be specified at the same time. If the condition is not specified, it means that the condition is satisfied in all the target row keys.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void add(K key)
      Appends the value of the RowKey as one of the elements of the individual condition.
      static <K> RowKeyPredicate<K> create(java.lang.Class<K> keyType)
      Creates an instance of RowKeyPredicate with the GSType corresponding to the specified Class as the RowKey type.
      static RowKeyPredicate<java.lang.Object> create(GSType keyType)
      Creates an instance of RowKeyPredicate with the specified GSType as the RowKey type.
      java.util.Collection<K> getDistinctKeys()
      Returns a Collection containing all of the values of the row keys that make up the individual condition.
      K getFinish()
      Returns the value of RowKey at the last position of the range condition.
      GSType getKeyType()
      Returns the type of RowKey used as a search condition.
      K getStart()
      Returns the value of the RowKey at the starting position of the range condition.
      void setFinish(K finishKey)
      Sets the value of the RowKey at the last position of the range condition.
      void setStart(K startKey)
      Sets the value of the RowKey at the starting positionof the range condition.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • add

        public void add(K key)
                 throws GSException
        Appends the value of the RowKey as one of the elements of the individual condition.

        A RowKey with the same value as the added value is deemed as conforming.

        Parameters:
        key - value of RowKey to be appended as one of the elements of the individual condition. Must not be a null value.
        Throws:
        GSException - if a range condition had already been set
        java.lang.ClassCastException - the value of the specified key is not NULL or the type is not supported as RowKey
      • create

        public static <K> RowKeyPredicate<K> create(java.lang.Class<K> keyType)
                                         throws GSException
        Creates an instance of RowKeyPredicate with the GSType corresponding to the specified Class as the RowKey type.

        The target Container must have a RowKey, and the type of the RowKey must be the specified GSType

        The type of RowKey that can be set is only that allowed by either one of the subinterfaces of Container. For the correspondence of Class to GSType, see the definition of Container.

        Parameters:
        keyType - Class corresponding to a RowKey used as a search condition
        Returns:
        RowKeyPredicate newly created
        Throws:
        GSException - if the specified type is not always supported as a RowKey
        java.lang.NullPointerException - if null is specified in the argument.
        See Also:
        Container
      • create

        public static RowKeyPredicate<java.lang.Object> create(GSType keyType)
                                                        throws GSException
        Creates an instance of RowKeyPredicate with the specified GSType as the RowKey type.

        The target Container must have a RowKey, and the type of the RowKey must be the specified GSType

        Unlike create(Class), this method is used when the type of RowKey is not specified when the application is compiled. However, the criteria for checking the RowKey type when setting the condition is the same as create(Class).

        The type of RowKey that can be set is only that allowed by either one of the subinterfaces of Container.

        Parameters:
        keyType - type of RowKey used as a search condition
        Returns:
        RowKeyPredicate newly created
        Throws:
        GSException - if the specified type is not always supported as a RowKey
        java.lang.NullPointerException - if null is specified in the argument.
        See Also:
        Container
      • getDistinctKeys

        public java.util.Collection<K> getDistinctKeys()
        Returns a Collection containing all of the values of the row keys that make up the individual condition.

        It is not defined whether an exception like UnsupportedOperationException will occur during execution, when a returned object is updated. Moreover, after an object is returned, it is not defined whether an update of this object will change the contents of the returned object.

        Returns:
        Collection containing all of the values of the row keys that make up the individual condition.
      • getFinish

        public K getFinish()
        Returns the value of RowKey at the last position of the range condition.
        Returns:
        the value of RowKey at the last position of the range condition, or null if it is not set.
      • getKeyType

        public GSType getKeyType()
        Returns the type of RowKey used as a search condition.
        Returns:
        the type of RowKey used as a search condition.
      • getStart

        public K getStart()
        Returns the value of the RowKey at the starting position of the range condition.
        Returns:
        the value of RowKey at the starting position of the range condition, or null if it is not set.
      • setFinish

        public void setFinish(K finishKey)
                       throws GSException
        Sets the value of the RowKey at the last position of the range condition.

        A RowKey with a value larger than the specified value is deemed as non-conforming.

        A type with an undefined magnitude relationship can be set as a condition but cannot be used in the actual judgment e.g. STRING type

        Parameters:
        finishKey - the value of RowKey at the last position or null. For null, the setting is cancelled.
        Throws:
        GSException - if an individual condition had been set already
        java.lang.ClassCastException - the value of specified key is not NULL or the type is not supported as RowKey
      • setStart

        public void setStart(K startKey)
                      throws GSException
        Sets the value of the RowKey at the starting positionof the range condition.

        A RowKey with a value smaller than the specified value is deemed as non-conforming.

        A type with an undefined magnitude relationship can be set as a condition but cannot be used in the actual judgment, e.g. STRING type

        Parameters:
        startKey - value of RowKey at the starting position or null. For null, the setting is cancelled.
        Throws:
        GSException - if an individual condition had been set already
        java.lang.ClassCastException - the specified RowKey is not NULL or the type is not supported as RowKey

Interface RowSet<R>

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable


    public interface RowSet<R>
    extends java.io.Closeable
    Manages a set of Rows obtained by executing a query.

    It has a function of per-Row and per-Row-field manipulation and holds a cursor state similar to ResultSet to specify a target Row. The cursor is initially located just before the head of a Row set.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void close()
      Releases related resources as necessary.
      boolean hasNext()
      Returns TRUE if a Row set has at least one Row ahead of the current cursor position.
      R next()
      Moves the cursor to the next Row in a Row set and returns the Row object at the moved position.
      void remove()
      Deletes the Row at the current cursor position.
      int size()
      Returns the size, namely the number of Rows at the time of creating a Row set.
      void update(R rowObj)
      Updates the values except a Row key of the Row at the cursor position, using the specified Row object.
    • Method Detail

      • close

        void close()
                   throws GSException
        Releases related resources as necessary.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        GSException - It will not be thrown in the current version.
        See Also:
        Closeable.close()
      • hasNext

        boolean hasNext()
                        throws GSException
        Returns TRUE if a Row set has at least one Row ahead of the current cursor position.
        Throws:
        GSException - It will not be thrown in the current version.
      • next

        R next()
               throws GSException
        Moves the cursor to the next Row in a Row set and returns the Row object at the moved position.
        Throws:
        GSException - if there is no Row at the cursor position.
        GSException - if a connection failure caused an error in creation of a Row object
        GSException - if called after this object or the relevant Container is closed.
      • remove

        void remove()
                    throws GSException
        Deletes the Row at the current cursor position.

        It can be used only for RowSet obtained with locking enabled. Like Container.remove(Object), further limitations are placed depending on the type and settings of a Container.

        Throws:
        GSException - if there is no Row at the cursor position.
        GSException - If called on RowSet obtained without locking enabled.
        GSException - if its operation is contrary to the restrictions specific to a particular Container.
        GSException - if a timeout occurs during this operation or its related transaction, the relevant Container is deleted, its schema is changed or a connection failure occurs.
        GSException - if called after this object or the relevant Container is closed.
      • size

        int size()
        Returns the size, namely the number of Rows at the time of creating a Row set.
      • update

        void update(R rowObj)
                    throws GSException
        Updates the values except a Row key of the Row at the cursor position, using the specified Row object.

        null cannot be specified. The Row key contained in the specified Row object is ignored.

        It can be used only forRowSet obtained with locking enabled. Like Container.put(Object, Object), further limitations are placed depending on the type and settings of a Container.

        Throws:
        GSException - if there is no Row at the cursor position.
        GSException - If called on RowSet obtained without locking enabled.
        GSException - if its operation is contrary to the restrictions specific to a particular Container.
        GSException - if a timeout occurs during this operation or its related transaction, the relevant Container is deleted, its schema is changed or a connection failure occurs.
        GSException - if called after this object or the relevant Container is closed.
        java.lang.ClassCastException - if the specified Row object does not match the value types of the Row object used in mapping operation.
        java.lang.NullPointerException - If a null parameter is specified; or if no object exists in the Row object which corresponds to the Row field.

Enum TimeOperator

  • java.lang.Object
    • java.lang.Enum<TimeOperator>
      • com.toshiba.mwcloud.gs.TimeOperator
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TimeOperator>


    public enum TimeOperator
    extends java.lang.Enum<TimeOperator>
    Represents how to specify a Row based on a key timestamp of TimeSeries.

    It can be used in combination with the timestamp (specified separately) to specify a Row with the nearest timestamp etc. When no relevant Row exists, it behaves differently depending on the function using this enumeration type.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      NEXT
      Returns the oldest among the Rows whose timestamp are identical with or later than the specified time.
      NEXT_ONLY
      Returns the oldest among the Rows whose timestamp are later than the specified time.
      PREVIOUS
      Returns the newest among the Rows whose timestamp are identical with or earlier than the specified time.
      PREVIOUS_ONLY
      Returns the newest among the Rows whose timestamp are earlier than the specified time.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static TimeOperator valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TimeOperator[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NEXT

        public static final TimeOperator NEXT
        Returns the oldest among the Rows whose timestamp are identical with or later than the specified time.
      • NEXT_ONLY

        public static final TimeOperator NEXT_ONLY
        Returns the oldest among the Rows whose timestamp are later than the specified time.
      • PREVIOUS

        public static final TimeOperator PREVIOUS
        Returns the newest among the Rows whose timestamp are identical with or earlier than the specified time.
      • PREVIOUS_ONLY

        public static final TimeOperator PREVIOUS_ONLY
        Returns the newest among the Rows whose timestamp are earlier than the specified time.
    • Method Detail

      • valueOf

        public static TimeOperator valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static TimeOperator[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TimeOperator c : TimeOperator.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Interface TimeSeries<R>

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable, Container<java.util.Date,R>


    public interface TimeSeries<R>
    extends Container<java.util.Date,R>
    A specialized Container with a time-type Row key for TimeSeries data operation.

    Generally, in extraction of a specific range and aggregation operations on TimeSeries, more efficient implementation is selected than on Collection.

    If the order of Rows requested by Container.query(String) or GridStore.multiGet(java.util.Map) is not specified, the Rows in a result set are sorted in ascending order of Row key.

    The granularity of locking is an internal storage unit, i.e., a set of one or more Rows. Accordingly, when locking a specific Row, GridDB will attempt to lock other Rows in the same internal storage unit as the Row.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      AggregationResult aggregate(java.util.Date start, java.util.Date end, java.lang.String column, Aggregation aggregation)
      Performs an aggregation operation on a Row set or its specific Columns, based on the specified start and end times.
      boolean append(R row)
      Newly creates or updates a Row with a Row key of the current time on GridDB.
      R get(java.util.Date key)
      Returns the content of a Row corresponding to the Row key, based on the specified option.
      R get(java.util.Date base, TimeOperator timeOp)
      Returns one Row related with the specified time.
      R interpolate(java.util.Date base, java.lang.String column)
      Performs linear interpolation etc. of a Row object corresponding to the specified time.
      boolean put(java.util.Date key, R row)
      Newly creates or updates a Row, based on the specified Row object and also the Row key specified as needed.
      Query<R> query(java.util.Date start, java.util.Date end)
      Creates a query to obtain a set of Rows within a specific range between the specified start and end times.
      Query<R> query(java.util.Date start, java.util.Date end, QueryOrder order)
      Creates a query to obtain a set of Rows sorted in the specified order within a specific range between the specified start and end times.
      Query<R> query(java.util.Date start, java.util.Date end, java.util.Set<java.lang.String> columnSet, InterpolationMode mode, int interval, TimeUnit intervalUnit)
      Creates a query to take a sampling of Rows within a specific range.
      boolean remove(java.util.Date key)
      Deletes a Row corresponding to the specified Row key.
    • Method Detail

      • aggregate

        AggregationResult aggregate(java.util.Date start,
                                  java.util.Date end,
                                  java.lang.String column,
                                  Aggregation aggregation)
                                    throws GSException
        Performs an aggregation operation on a Row set or its specific Columns, based on the specified start and end times.

        The parameter column might be ignored depending on the parameter aggregation. The boundary Rows whose timestamps are identical with the start or end time are included in the range of operation. If the specified start time is later than the end time, all Rows are excluded from the range.

        Parameters:
        start - Start time
        end - End time
        column - The name of a target Column. Specify null if the specified aggregation method does not target a specific Column.
        aggregation - An aggregation method
        Returns:
        AggregationResult if the aggregation result is stored in it, or null if not. See the description of AggregationResult for more information.
        Throws:
        GSException - if the type of the specified Column is not supported by the specified aggregation method.
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed, or a connection failure occurs; or if called after the connection is closed.
        java.lang.NullPointerException - if null is specified as start,end, or aggregation.
        See Also:
        Aggregation
      • append

        boolean append(R row)
                       throws GSException
        Newly creates or updates a Row with a Row key of the current time on GridDB.

        It behaves in the same way as put(Date, Object), except that it sets as a Row key the TIMESTAMP value equivalent to the current time on GridDB. The Row key in the specified Row object is ignored.

        In the manual commit mode, the target Row is locked. Other Rows in the same internal storage unit are also locked.

        Parameters:
        row - A Row object representing the content of a Row to be newly created or updated.
        Returns:
        TRUE if a Row is found whose timestamp is identical with the current time on GridDB.
        Throws:
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed; or if an unsupported value is set in the Row object.
        java.lang.ClassCastException - if the specified key or Row object does not completely match the types used in mapping operation.
        java.lang.NullPointerException - if null is specified as row; or if the Row object lacks some object corresponding to a Row field.
        See Also:
        put(Date, Object), TimeSeriesProperties.getCompressionMethod()
      • get

        R get(java.util.Date key)
              throws GSException
        Returns the content of a Row corresponding to the Row key, based on the specified option.

        It behaves in the same way as Container.get(Object). However, since the type of a Row key is predetermined, ClassCastException will not be thrown.

        Specified by:
        get in interface Container<java.util.Date,R>
        Returns:
        TRUE if a corresponding Row exists.
        Throws:
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed; or if an unsupported value is specified as key.
        java.lang.NullPointerException - if a null parameter is specified.
        See Also:
        Container.get(Object)
      • get

        R get(java.util.Date base,
            TimeOperator timeOp)
              throws GSException
        Returns one Row related with the specified time.
        Parameters:
        base - a base time point
        timeOp - what to obtain
        Returns:
        The Row(s) satisfying the conditions; or null if no such Row is found.
        Throws:
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed; or if an unsupported value is specified as the base time point.
        java.lang.NullPointerException - if a null parameter is specified.
      • interpolate

        R interpolate(java.util.Date base,
                    java.lang.String column)
                      throws GSException
        Performs linear interpolation etc. of a Row object corresponding to the specified time.

        It creates a Row object, based on the value of the specified Column of the TimeSeries Row identical with the base time or the value obtained by linearly interpolating the values of the specified Columns of adjacent Rows around the base time. If there is no Row with the same timestamp as the base time nor no Row with an earlier or later timestamp, no Row object is created.

        Only Columns of numeric type can be interpolated. The field values of the Row whose timestamp is identical with the specified timestamp or the latest among those with earlier timestamps are set on the specified Column and the fields other than a Row key.

        Parameters:
        base - a base time point
        column - A Column to be interpolated
        Throws:
        GSException - if no Column has the specified name; or if an unsupported type of Column is specified.
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed; or if an unsupported value is specified as the base time point.
        java.lang.NullPointerException - if a null parameter is specified.
      • put

        boolean put(java.util.Date key,
                  R row)
                    throws GSException
        Newly creates or updates a Row, based on the specified Row object and also the Row key specified as needed.

        It newly creates a Row, based on the value of the Row key specified as key or the Row key in the specified Row object if key is not specified.

        In the manual commit mode, the target Row is locked. Other Rows in the same internal storage unit are also locked.

        Specified by:
        put in interface Container<java.util.Date,R>
        Parameters:
        key - A target Row key
        row - A Row object representing the content of a Row to be newly created or updated.
        Returns:
        TRUE if a Row is found whose timestamp is identical with the specified time.
        Throws:
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed; or if an unsupported value is set in the Row object.
        java.lang.ClassCastException - if the specified key or Row object does not completely match the types used in mapping operation.
        java.lang.NullPointerException - if null is specified as row; or if the Row object lacks some object corresponding to a Row field.
        See Also:
        Container.put(Object, Object), TimeSeriesProperties.getCompressionMethod()
      • query

        Query<R> query(java.util.Date start,
                     java.util.Date end)
                       throws GSException
        Creates a query to obtain a set of Rows within a specific range between the specified start and end times.

        The boundary Rows whose timestamps are identical with the start or end time are included in the range of fetch. If the specified start time is later than the end time, all Rows are excluded from the range. The Rows in a result set are sorted in ascending order, i.e., from an earlier timestamp to a later timestamp.

        The option of locking for update can be enabled when obtaining a set of Rows using Query.fetch(boolean).

        Parameters:
        start - start time or null. A null value indicates the timestamp of the oldest Row in this TimeSeries.
        end - end time or null. A null value indicates the timestamp of the newest Row in this TimeSeries.
        Throws:
        GSException - It will not be thrown in the current version.
      • query

        Query<R> query(java.util.Date start,
                     java.util.Date end,
                     QueryOrder order)
                       throws GSException
        Creates a query to obtain a set of Rows sorted in the specified order within a specific range between the specified start and end times.

        The boundary Rows whose timestamps are identical with the start or end time are included in the range of fetch. If the specified start time is later than the end time, all Rows are excluded from the range.

        The option of locking for update can be enabled when obtaining a set of Rows using Query.fetch(boolean).

        Parameters:
        start - start time or null. A null value indicates the timestamp of the oldest Row in this TimeSeries.
        end - end time or null. A value indicates the timestamp of the newest Row in this TimeSeries.
        order - the time order of Rows in a result set. QueryOrder.ASCENDING indicates the order from older to newer, and QueryOrder.DESCENDING indicates the order from newer to older.
        Throws:
        GSException - It will not be thrown in the current version.
      • query

        Query<R> query(java.util.Date start,
                     java.util.Date end,
                     java.util.Set<java.lang.String> columnSet,
                     InterpolationMode mode,
                     int interval,
                     TimeUnit intervalUnit)
                       throws GSException
        Creates a query to take a sampling of Rows within a specific range.

        Each sampling time point is defined by adding a sampling interval multiplied by a non-negative integer to the start time, excluding the time points later than the end time. If the specified start time is later than the end time, all Rows are excluded from the range.

        If executed, the query creates a set of Rows, using the values of the Rows whose timestamps are identical with each sampling time point, or the interpolated values according to the parameters columnSet and mode if such a Row is not found. For specific interpolation methods, see the description of InterpolationMode.

        If there is no Rows to be referenced for interpolation at a specific sampling time point, a corresponding Row is not generated, and thus the number of results returned is reduced by the number of such time points. A shorter sampling interval increases the likelihood that identical Row field values will be used even at different sampling time points, depending on the interpolation method.

        The option of locking for update cannot be enabled when obtaining a set of Rows using Query.fetch(boolean).

        Parameters:
        start - start time
        end - end time
        columnSet - a set of names of the Columns to be interpolated according to mode. An empty set indicates no specification of target Columns. A null value indicates the same as an empty set.
        mode - an interpolation method
        interval - a sampling interval.0 or a negative value cannot be specified.
        intervalUnit - the time unit of the sampling interval. TimeUnit.YEAR and TimeUnit.MONTH cannot be specified.
        Throws:
        GSException - It will not be thrown in the current version.
      • remove

        boolean remove(java.util.Date key)
                       throws GSException
        Deletes a Row corresponding to the specified Row key.

        It can be used only if a Column exists which corresponds to a specified Row key. If no corresponding Row exists, nothing is changed.

        In the manual commit mode, the target Row is locked.

        Specified by:
        remove in interface Container<java.util.Date,R>
        Returns:
        TRUE if a corresponding Row exists.
        Throws:
        GSException - if no Column exists which corresponds to the specified Row key.
        GSException - if a timeout occurs during this operation or the transaction, this Container is deleted, its schema is changed or a connection failure occurs; or if called after the connection is closed; or if an unsupported value is specified as key.
        java.lang.ClassCastException - if the specified Row key does not match the type of a Row key used in mapping operation.
        java.lang.NullPointerException - if a null parameter is specified.
        See Also:
        Container.remove(Object), TimeSeriesProperties.getCompressionMethod()

Class TimeSeriesProperties

  • java.lang.Object
    • com.toshiba.mwcloud.gs.TimeSeriesProperties
  • All Implemented Interfaces:
    java.lang.Cloneable


    public class TimeSeriesProperties
    extends java.lang.Object
    implements java.lang.Cloneable
    Represents the information about optional configuration settings used for newly creating or updating a TimeSeries.

    It does not guarantee the validity of values e.g. the upper limit of the column number that can be individually compressed.

    • Constructor Detail

      • TimeSeriesProperties

        public TimeSeriesProperties()
        Returns a default instance of TimeSeriesProperties.
    • Method Detail

      • clone

        public TimeSeriesProperties clone()
        Creates new TimeSeriesProperties with the same settings as this object.
        Overrides:
        clone in class java.lang.Object
        Returns:
        Creates and returns a copy of this object.
      • getCompressionMethod

        public CompressionMethod getCompressionMethod()
        Not supported
      • getCompressionRate

        public java.lang.Double getCompressionRate(java.lang.String column)
        Not supported
      • getCompressionSpan

        public java.lang.Double getCompressionSpan(java.lang.String column)
        Not supported
      • getCompressionWidth

        public java.lang.Double getCompressionWidth(java.lang.String column)
        Not supported
      • getCompressionWindowSize

        public int getCompressionWindowSize()
        Not supported
      • getCompressionWindowSizeUnit

        public TimeUnit getCompressionWindowSizeUnit()
        Not supported
      • getExpirationDivisionCount

        public int getExpirationDivisionCount()
        Return the division number for the validity period that corresponds to the number of expired rows data units to be released.
        Returns:
        Division number of the validity period. -1 if unspecified.
        See Also:
        setExpirationDivisionCount(int)
      • getRowExpirationTime

        public int getRowExpirationTime()
        Returns the elapsed time period of a Row to be used as the basis of the validity period.
        Returns:
        The elapsed time period to be used as the basis of the validity period. -1 if unspecified.
      • getRowExpirationTimeUnit

        public TimeUnit getRowExpirationTimeUnit()
        Returns the unit of the elapsed time period of a Row to be used as the basis of the validity period.
        Returns:
        The unit of the elapsed time period to be used as the basis of the validity period. null if unspecified.
      • getSpecifiedColumns

        public java.util.Set<java.lang.String> getSpecifiedColumns()
        Not supported
      • isCompressionRelative

        public java.lang.Boolean isCompressionRelative(java.lang.String column)
        Not supported
      • setAbsoluteHiCompression

        public void setAbsoluteHiCompression(java.lang.String column,
                                    double width)
        Not supported
      • setCompressionMethod

        public void setCompressionMethod(CompressionMethod compressionMethod)
        Not supported
      • setCompressionWindowSize

        public void setCompressionWindowSize(int compressionWindowSize,
                                    TimeUnit compressionWindowSizeUnit)
        Not supported
      • setExpirationDivisionCount

        public void setExpirationDivisionCount(int count)
        Sets the division number for the validity period as the number of expired row data units to be released.

        The division number set is used to control the conditions for releasing row data management areas that have expired in GridDB. Expired row data shall be released at the point they are collected only when the period equivalent to the division number is reached.

        It will be failed if the division number exceeds the size limit. See "System limiting values" in the GridDB API Reference for the division number upper limit.

        Parameters:
        count - the division number for the validity period. Must not be 0 or less.
        Throws:
        java.lang.IllegalArgumentException - if the division number is specified as 0 or less.
      • setRelativeHiCompression

        public void setRelativeHiCompression(java.lang.String column,
                                    double rate,
                                    double span)
        Not supported
      • setRowExpiration

        public void setRowExpiration(int elapsedTime,
                            TimeUnit timeUnit)
        Sets the elapsed time period of a Row to be used as the basis of validity period.

        The validity period of a Row can be obtained by adding the specified elapsed time period to the timestamp of the Row key. Rows whose expiration times are older than the current time on GridDB are treated as expired Rows. Expired Rows are treated as non existent and are not used for search, update or other Row operations. The corresponding internal data in GridDB will be deleted as needed.

        The current time used for expiry check is dependent on the runtime environment of each node of GridDB. Therefore, there may be cases where unexpired Rows cannot be accessed before the VM time, or expired Rows can be accessed after the VM time because of a network delay or a discrepancy in the time setting of the runtime environment. In order to avoid unintended loss of Rows, you should set a value larger than the minimum required period of time.

        The setting for an already-created TimeSeries cannot be changed.

        Parameters:
        elapsedTime - the elapsed time period of a Row to be used as the basis of the validity period. Must not be 0 or less.
        timeUnit - the unit of the elapsed time period. TimeUnit.YEAR or TimeUnit.MONTH cannot be specified.
        Throws:
        java.lang.IllegalArgumentException - if elapsedTime or timeUnit of out of range is specified
        java.lang.IllegalArgumentException - if a column value with an incorrect format
        java.lang.NullPointerException - if null is specified in the argument.

Enum TimeUnit

  • java.lang.Object
    • java.lang.Enum<TimeUnit>
      • com.toshiba.mwcloud.gs.TimeUnit
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TimeUnit>


    public enum TimeUnit
    extends java.lang.Enum<TimeUnit>
    Represents the time unit(s) used in TimeSeries data operation.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static TimeUnit valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TimeUnit[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • HOUR

        public static final TimeUnit HOUR
      • MILLISECOND

        public static final TimeUnit MILLISECOND
      • MINUTE

        public static final TimeUnit MINUTE
      • MONTH

        public static final TimeUnit MONTH
      • SECOND

        public static final TimeUnit SECOND
      • YEAR

        public static final TimeUnit YEAR
    • Method Detail

      • valueOf

        public static TimeUnit valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static TimeUnit[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TimeUnit c : TimeUnit.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Class TimestampUtils

  • java.lang.Object
    • com.toshiba.mwcloud.gs.TimestampUtils


  • public class TimestampUtils
    extends java.lang.Object
    Provides the utilities for manipulating time data.
    • Constructor Summary

      Constructors 
      Constructor and Description
      TimestampUtils() 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.util.Date add(java.util.Date timeStamp, int amount, TimeUnit timeUnit)
      Adds a specific value to the specified time.
      static java.util.Date current()
      Returns the current time.
      static java.util.Calendar currentCalendar()
      Returns the current time as a Calendar object.
      static java.lang.String format(java.util.Date timeStamp)
      Returns the string representing the specified time, according to the TIMESTAMP value notation of TQL.
      static java.text.DateFormat getFormat()
      Returns the date format conforming to the TIMESTAMP value notation of TQL.
      static java.util.Date parse(java.lang.String source)
      Returns a Date object corresponding to the specified string, according to the TIMESTAMP value notation of TQL.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TimestampUtils

        public TimestampUtils()
    • Method Detail

      • add

        public static java.util.Date add(java.util.Date timeStamp,
                         int amount,
                         TimeUnit timeUnit)
        Adds a specific value to the specified time.

        An earlier time than the specified time can be obtained by specifying a negative value as amount.

        The current version uses the UTC timezone for calculation.

      • current

        public static java.util.Date current()
        Returns the current time.
      • currentCalendar

        public static java.util.Calendar currentCalendar()
        Returns the current time as a Calendar object.

        The current version always uses the UTC timezone.

      • format

        public static java.lang.String format(java.util.Date timeStamp)
        Returns the string representing the specified time, according to the TIMESTAMP value notation of TQL.

        The current version uses the UTC timezone for conversion.

      • getFormat

        public static java.text.DateFormat getFormat()
        Returns the date format conforming to the TIMESTAMP value notation of TQL.

        The time representation containing a negative year value is not supported.

      • parse

        public static java.util.Date parse(java.lang.String source)
                                    throws java.text.ParseException
        Returns a Date object corresponding to the specified string, according to the TIMESTAMP value notation of TQL.
        Throws:
        java.text.ParseException - if the specified string does not match any time representation.

Annotation Type TransientRowField



  • @Retention(value=RUNTIME)
    @Target(value={FIELD,METHOD})
    public @interface TransientRowField
    Specifies a Row field not to be mapped in operations on a Container.

Enum TriggerInfo.EventType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TriggerInfo.EventType>
    Enclosing class:
    TriggerInfo


    public static enum TriggerInfo.EventType
    extends java.lang.Enum<TriggerInfo.EventType>
    Represent the update operation type subject to monitoring by the trigger.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      DELETE
      Indicate the deletion of a row for a Container.
      PUT
      Indicate the creation of a new row or update of an existing row for a Container.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static TriggerInfo.EventType valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TriggerInfo.EventType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • DELETE

        public static final TriggerInfo.EventType DELETE
        Indicate the deletion of a row for a Container.
      • PUT

        public static final TriggerInfo.EventType PUT
        Indicate the creation of a new row or update of an existing row for a Container.
    • Method Detail

      • valueOf

        public static TriggerInfo.EventType valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static TriggerInfo.EventType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TriggerInfo.EventType c : TriggerInfo.EventType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Enum TriggerInfo.Type

  • java.lang.Object
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TriggerInfo.Type>
    Enclosing class:
    TriggerInfo


    public static enum TriggerInfo.Type
    extends java.lang.Enum<TriggerInfo.Type>
    Represent the trigger type.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      JMS
      Indicate the trigger type to notify in a Java Message Service (JMS) notification when a Container is updated.
      REST
      Indicate the trigger type to notify in a REST notification when a Container is updated.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static TriggerInfo.Type valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TriggerInfo.Type[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • JMS

        public static final TriggerInfo.Type JMS
        Indicate the trigger type to notify in a Java Message Service (JMS) notification when a Container is updated.
      • REST

        public static final TriggerInfo.Type REST
        Indicate the trigger type to notify in a REST notification when a Container is updated.
    • Method Detail

      • valueOf

        public static TriggerInfo.Type valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static TriggerInfo.Type[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TriggerInfo.Type c : TriggerInfo.Type.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared

Class TriggerInfo

  • java.lang.Object
    • com.toshiba.mwcloud.gs.TriggerInfo


  • public class TriggerInfo
    extends java.lang.Object
    Represent the trigger information for monitoring the Container update.

    Regarding the validity of the contents such as the notation of the trigger name, this will not be necessarily inspected.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  TriggerInfo.EventType
      Represent the update operation type subject to monitoring by the trigger.
      static class  TriggerInfo.Type
      Represent the trigger type.
    • Constructor Summary

      Constructors 
      Constructor and Description
      TriggerInfo()
      Generate the trigger information.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.String getJMSDestinationName()
      Get the destination name used in a JMS notification.
      java.lang.String getJMSDestinationType()
      Get the destination type used in a JMS notification.
      java.lang.String getName()
      Get the trigger name.
      java.lang.String getPassword()
      Get password when connecting to a notification destination server.
      java.util.Set<java.lang.String> getTargetColumns()
      Get the column name subject to notification when a trigger is discharged.
      java.util.Set<TriggerInfo.EventType> getTargetEvents()
      Get the update operation type subject to trigger discharge.
      TriggerInfo.Type getType()
      Get the trigger type.
      java.net.URI getURI()
      Get the notification destination URI when the trigger is discharged.
      java.lang.String getUser()
      Get user name when connecting to a notification destination server.
      void setJMSDestinationName(java.lang.String destinationName)
      Set the destination name used in a JMS notification.
      void setJMSDestinationType(java.lang.String destinationType)
      Set the destination type used in a JMS notification.
      void setName(java.lang.String name)
      Set the trigger name.
      void setPassword(java.lang.String password)
      Set the password when connecting to a notification destination server.
      void setTargetColumns(java.util.Set<java.lang.String> columnSet)
      Set the column name subject to notification when a trigger is discharged.
      void setTargetEvents(java.util.Set<TriggerInfo.EventType> eventSet)
      Set the update operation type subject to trigger discharge.
      void setType(TriggerInfo.Type type)
      Set the trigger type.
      void setURI(java.net.URI uri)
      Set the notification destination URI when the trigger is discharged.
      void setUser(java.lang.String user)
      Set user name when connecting to a notification destination server.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TriggerInfo

        public TriggerInfo()
        Generate the trigger information.
    • Method Detail

      • getJMSDestinationName

        public java.lang.String getJMSDestinationName()
        Get the destination name used in a JMS notification.
      • getJMSDestinationType

        public java.lang.String getJMSDestinationType()
        Get the destination type used in a JMS notification.
      • getName

        public java.lang.String getName()
        Get the trigger name.
      • getPassword

        public java.lang.String getPassword()
        Get password when connecting to a notification destination server.

        In the current version, the user name is used only when connecting to the JMS server with a JMS notification.

      • getTargetColumns

        public java.util.Set<java.lang.String> getTargetColumns()
        Get the column name subject to notification when a trigger is discharged.

        When a returned value is updated, UnsupportedOperationException may occur. In addition, the contents of the returned object will not be changed by the operation on this object.

      • getTargetEvents

        public java.util.Set<TriggerInfo.EventType> getTargetEvents()
        Get the update operation type subject to trigger discharge.

        When a returned value is updated, UnsupportedOperationException may occur. In addition, the contents of the returned object will not be changed by the operation on this object.

      • getURI

        public java.net.URI getURI()
        Get the notification destination URI when the trigger is discharged.
      • getUser

        public java.lang.String getUser()
        Get user name when connecting to a notification destination server.

        In the current version, the user name is used only when connecting to the JMS server with a JMS notification.

      • setJMSDestinationName

        public void setJMSDestinationName(java.lang.String destinationName)
        Set the destination name used in a JMS notification.

        If null is specified, an error occurs when Container.createTrigger(TriggerInfo) is executed.

      • setJMSDestinationType

        public void setJMSDestinationType(java.lang.String destinationType)
        Set the destination type used in a JMS notification.

        "queue" or "topic" can be specified. Case sensitive.

        If a character string other than "queue" or "topic" is specified, an error occurs when Container.createTrigger(TriggerInfo) is executed.

      • setName

        public void setName(java.lang.String name)
        Set the trigger name.

        If a blank character string or null is set, an error occurs when Container.createTrigger(TriggerInfo) is executed.

      • setPassword

        public void setPassword(java.lang.String password)
        Set the password when connecting to a notification destination server.

        In the current version, the user name is used only when connecting to the JMS server with a JMS notification.

        If there is no setting, or if a blank character string/null is set, the blank character string will be used as the password in the connection.

        If both the user name and password have not been set, or if a blank character string/null is set, the user will be connected without using the user name and password.

      • setTargetColumns

        public void setTargetColumns(java.util.Set<java.lang.String> columnSet)
        Set the column name subject to notification when a trigger is discharged.

        The column name is not case-sensitive. Even if the same column name is set several times, the value of the column will only be set once in the notification.

        If the column name is not specified, none of the column values will be set in the notification.

        The contents of the specified object will not change even if they are changed after they have been invoked.

        Throws:
        java.lang.NullPointerException - If null is specified in the argument
      • setTargetEvents

        public void setTargetEvents(java.util.Set<TriggerInfo.EventType> eventSet)
        Set the update operation type subject to trigger discharge.

        If multiple update operations are set, a trigger will be discharges if any one of these operations is carried out.

        If there is no update operation setting, an error occurs when Container.createTrigger(TriggerInfo) is executed.

        The contents of the specified object will not change even if they are changed after they have been invoked.

        Throws:
        java.lang.NullPointerException - If null is specified in the argument
      • setURI

        public void setURI(java.net.URI uri)
        Set the notification destination URI when the trigger is discharged.

        If null is set, an error occurs when Container.createTrigger(TriggerInfo) is executed.

      • setUser

        public void setUser(java.lang.String user)
        Set user name when connecting to a notification destination server.

        In the current version, the user name is used only when connecting to the JMS server with a JMS notification.

        If there is no setting, or if a blank character string/null is set, the blank character string will be used as the user name in the connection.

        If both the user name and password have not been set, or if a blank character string/null is set, the user will be connected without using the user name and password.

Serialized Form

  • Package com.toshiba.mwcloud.gs

    • Class com.toshiba.mwcloud.gs.GSException extends java.io.IOException implements Serializable

      serialVersionUID:
      -7261622831192521426L
      • Serialized Fields

        • errorCode

          int errorCode
        • errorName

          java.lang.String errorName
        • description

          java.lang.String description
    • Class com.toshiba.mwcloud.gs.GSRecoverableException extends GSException implements Serializable

      serialVersionUID:
      1241771194878438360L
    • Class com.toshiba.mwcloud.gs.GSTimeoutException extends GSException implements Serializable

      serialVersionUID:
      -2321647495394140580L

5.2 APIサンプル(Java)

5.2.1 コレクション操作のサンプル(Java)

package gsSample;
import java.util.Arrays;
import java.util.Properties;

import com.toshiba.mwcloud.gs.Collection;
import com.toshiba.mwcloud.gs.GSException;
import com.toshiba.mwcloud.gs.GridStore;
import com.toshiba.mwcloud.gs.GridStoreFactory;
import com.toshiba.mwcloud.gs.Query;
import com.toshiba.mwcloud.gs.RowKey;
import com.toshiba.mwcloud.gs.RowSet;


// Operaton on Collection data
public class Sample1 {

	static class Person {
		@RowKey String name;
		boolean status;
		long count;
		byte[] lob;
	}

	public static void main(String[] args) throws GSException {

		// Get a GridStore instance
		Properties props = new Properties();
		props.setProperty("notificationAddress", args[0]);
		props.setProperty("notificationPort", args[1]);
		props.setProperty("clusterName", args[2]);
		props.setProperty("user", args[3]);
		props.setProperty("password", args[4]);
		GridStore store = GridStoreFactory.getInstance().getGridStore(props);

		// Create a Collection (Delete if schema setting is NULL)
		Collection<String, Person> col = store.putCollection("col01", Person.class);

		// Set an index on the Row-key Column
		col.createIndex("name");

		// Set an index on the Column
		col.createIndex("count");

		// Set the autocommit mode to OFF
		col.setAutoCommit(false);

		// Prepare data for a Row
		Person person = new Person();
		person.name = "name01";
		person.status = false;
		person.count = 1;
		person.lob = new byte[] { 65, 66, 67, 68, 69, 70, 71, 72, 73, 74 };

		// Operate a Row on a K-V basis: RowKey = "name01"
		boolean update = true;
		col.put(person);	// Add a Row
		person = col.get(person.name, update);	// Obtain the Row (acquiring a lock for update)
		col.remove(person.name);	// Delete the Row

		// Operate a Row on a K-V basis: RowKey = "name02"
		col.put("name02", person);	// Add a Row (specifying RowKey)

		// Commit the transaction (Release the lock)
		col.commit();

		// Search the Collection for a Row
		Query<Person> query = col.query("select * where name = 'name02'");

		// Fetch and update the searched Row
		RowSet<Person> rs = query.fetch(update);
		while (rs.hasNext()) {
			// Update the searched Row
			Person person1 = rs.next();
			person1.count += 1;
			rs.update(person1);

			System.out.println("Person: " +
					" name=" + person1.name +
					" status=" + person1.status +
					" count=" + person1.count +
					" lob=" + Arrays.toString(person1.lob));
		}

		// Commit the transaction
		col.commit();

		// Release the resource
		store.close();
	}

}

5.2.2 時系列操作のサンプル ― 登録・範囲取得(Java)

package gsSample;


import java.util.Date;
import java.util.Properties;

import com.toshiba.mwcloud.gs.GSException;
import com.toshiba.mwcloud.gs.GridStore;
import com.toshiba.mwcloud.gs.GridStoreFactory;
import com.toshiba.mwcloud.gs.RowKey;
import com.toshiba.mwcloud.gs.RowSet;
import com.toshiba.mwcloud.gs.TimeSeries;
import com.toshiba.mwcloud.gs.TimeUnit;
import com.toshiba.mwcloud.gs.TimestampUtils;


// Storage and extraction of a specific range of time-series data
public class Sample2 {

	static class Point {
		@RowKey Date timestamp;
		boolean active;
		double voltage;
	}

	public static void main(String[] args) throws GSException {

		// Get a GridStore instance
		Properties props = new Properties();
		props.setProperty("notificationAddress", args[0]);
		props.setProperty("notificationPort", args[1]);
		props.setProperty("clusterName", args[2]);
		props.setProperty("user", args[3]);
		props.setProperty("password", args[4]);
		GridStore store = GridStoreFactory.getInstance().getGridStore(props);

		// Create a TimeSeries (Only obtain the specified TimeSeries if it already exists)
		TimeSeries<Point> ts = store.putTimeSeries("point01", Point.class);

		// Prepare time-series element data
		Point point = new Point();
		point.active = false;
		point.voltage = 100;

		// Store the time-series element (GridStore sets its timestamp)
		ts.append(point);

		// Extract the specified range of time-series elements: last six hours
		Date now = TimestampUtils.current();
		Date before = TimestampUtils.add(now, -6, TimeUnit.HOUR);

		RowSet<Point> rs = ts.query(before, now).fetch();

		while (rs.hasNext()) {
			point = rs.next();

			System.out.println(
					"Time=" + TimestampUtils.format(point.timestamp) +
					" Active=" + point.active +
					" Voltage=" + point.voltage);
		}

		// Release the resource
		store.close();
	}

}

5.2.3 時系列操作のサンプル ― 検索・集計(Java)

package gsSample;


import java.util.Date;
import java.util.Properties;

import com.toshiba.mwcloud.gs.Aggregation;
import com.toshiba.mwcloud.gs.AggregationResult;
import com.toshiba.mwcloud.gs.GSException;
import com.toshiba.mwcloud.gs.GridStore;
import com.toshiba.mwcloud.gs.GridStoreFactory;
import com.toshiba.mwcloud.gs.Query;
import com.toshiba.mwcloud.gs.RowKey;
import com.toshiba.mwcloud.gs.RowSet;
import com.toshiba.mwcloud.gs.TimeOperator;
import com.toshiba.mwcloud.gs.TimeSeries;
import com.toshiba.mwcloud.gs.TimeUnit;
import com.toshiba.mwcloud.gs.TimestampUtils;


// Search and aggregation of time-series data
public class Sample3 {

	static class Point {
		@RowKey Date timestamp;
		boolean active;
		double voltage;
	}

	public static void main(String[] args) throws GSException {

		// Lower the consistency level because of read-only operation (default: IMMEDIATE)
		Properties props = new Properties();
		props.setProperty("notificationAddress", args[0]);
		props.setProperty("notificationPort", args[1]);
		props.setProperty("clusterName", args[2]);
		props.setProperty("user", args[3]);
		props.setProperty("password", args[4]);
		props.setProperty("consistency", "EVENTUAL");

		// Get a GridStore instance
		GridStore store = GridStoreFactory.getInstance().getGridStore(props);

		// Obtain a TimeSeries
		// ※ Use the Point class as in Sample 2
		TimeSeries<Point> ts = store.getTimeSeries("point01", Point.class);

		// Search for the locations whose voltage is not lower than a reference value, though not in action.
		Query<Point> query = ts.query(
				"select * from point01" +
				" where not active and voltage > 50");
		RowSet<Point> rs = query.fetch();

		while (rs.hasNext()) {
			// Examine each abnormal point

			Point hotPoint = rs.next();
			Date hot = hotPoint.timestamp;

			// Obtain the data around ten minutes before
			Date start = TimestampUtils.add(hot, -10, TimeUnit.MINUTE);
			Point startPoint = ts.get(start, TimeOperator.NEXT);

			// Calculate the average of the data for 20 minutes around the point
			Date end = TimestampUtils.add(hot, 10, TimeUnit.MINUTE);
			AggregationResult avg =
				ts.aggregate(start, end, "voltage", Aggregation.AVERAGE);

			System.out.println(
					"[Alert] " + TimestampUtils.format(hot) +
					" start=" + startPoint.voltage +
					" hot=" + hotPoint.voltage +
					" avg=" + avg.getDouble());
		}

		// Release the resource
		store.close();
	}

}

6 付録

6.1 値の範囲

値の上限などの値の範囲を説明します。 システムの制限値については、システムの制限値を参照してください。

6.1.1 基本型の取りうる値

以下の基本型の取りうる値は、次の通りです。


取りうる値
ブール(BOOL)型真または偽
BYTE型-27から27-1
SHORT型-215から215-1
INTEGER型-231から231-1
LONG型-263から263-1
FLOAT型IEEE754準拠
DOUBLE型IEEE754準拠
時刻(TIMESTAMP)型西暦1970年1月1日のはじめから西暦9999年12月31日の終わりまで(UTC相当)。精度はミリ秒。うるう秒は扱わない

6.2 システムの制限値

ブロックサイズ64KB1MB
文字列型のデータサイズ31KB128KB
BLOB型のデータサイズ127MB1GB
配列長4000個65000個
カラム数1024個1024個
コンテナ名のサイズ約16KB約128KB
カラム名のサイズ256Byte256Byte
パーティションサイズ約64TB約1PB
クラスタ名64文字64文字
トリガー名のサイズ256Byte256Byte
トリガのURL4KB4KB
アフィニティグループ数1000010000
データアフィニティ文字列の長さ8文字8文字
解放期限付き時系列コンテナの分割数160160
GridDBノードが管理する通信バッファのサイズ約2GB約2GB
  • 文字列型、コンテナ名、カラム名、トリガ名、トリガのURL
    • 制限値はUTF-8エンコード相当

7 商標

  • GridDBは、株式会社東芝の商標です。
  • OracleとJavaは、Oracle Corporation 及びその子会社、関連会社の米国及びその他の国における登録商標です。文中の社名、商品名等は各社の商標または登録商標である場合があります。
  • その他製品名は、それぞれの所有者の商標または登録商標です。

    Copyright © 2013-2016 TOSHIBA CORPORATION