azure-data-tables-java
Azure Table Storage アプリケーションを Java で構築
大規模な構造化 NoSQL データの保存が必要ですか?このスキルは、適切な認証と効率的なクエリパターンを使用して、Azure Tables SDK for Java によるテーブルストレージソリューションの実装をサポートします。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“azure-data-tables-java”。 エンティティを作成して競合エラーを処理
预期结果:
TableEntity entity = new TableEntity("products", "laptop-001").addProperty("Name", "Laptop").addProperty("Price", 999.99);
try {
tableClient.createEntity(entity);
} catch (TableServiceException e) {
if (e.getResponse().getStatusCode() == 409) {
System.out.println("Entity already exists - use upsert instead");
}
}
正在使用“azure-data-tables-java”。 フィルターとプロジェクションを使用したクエリ
预期结果:
ListEntitiesOptions options = new ListEntitiesOptions()
.setFilter("PartitionKey eq 'electronics' and Price gt 100")
.setSelect("Name", "Price")
.setTop(10);
for (TableEntity entity : tableClient.listEntities(options, null, null)) {
System.out.printf("%s: $%.2f%n", entity.getProperty("Name"), entity.getProperty("Price"));
}
安全审计
安全This skill is safe for publication. All static analysis findings are false positives. The external_commands detections are Java code examples in markdown format, not shell execution. URL references are environment variable documentation examples, not hardcoded endpoints. The cryptographic and system reconnaissance flags are incorrect pattern matches on documentation text and getter method names.
质量评分
你能构建什么
アプリケーション状態ストレージ
ユーザーセッション、アプリケーション設定、または機能フラグを、高速なパーティションベースのルックアップで保存
IoT テレメトリデータ
デバイス ID をパーティションキー、タイムスタンプを行キーとして使用してセンサーデータを収集およびクエリ
製品カタログ管理
カテゴリベースのパーティションと効率的な価格/在庫状況クエリで製品在庫を管理
试试这些提示
Create a TableServiceClient using connection string authentication, then create a table called 'inventory' if it does not exist.
Show me how to create a new entity with partition key 'products', row key 'laptop-001', and properties Name, Price, and Quantity. Then retrieve and update the price.
Query all entities where PartitionKey equals 'electronics' and Price is greater than 100, returning only Name and Price properties with a limit of 10 results.
Create a batch transaction that inserts three entities with the same partition key 'batch' and row keys 'row1', 'row2', and 'row3' atomically.
最佳实践
- クエリが均等に分散され、ホットスポットを回避するようにパーティションキーを設計
- 最適なパフォーマンスのために、クエリでは常に PartitionKey でフィルター
- 同一パーティションキーを共有するエンティティへのアトミック更新にはバッチトランザクションを使用
避免
- タイムスタンプや連続値をパーティションキーとして使用すると、負荷分布が不均一になる
- PartitionKey フィルターなしでクエリを実行すると、テーブル全体のスキャンが発生し、パフォーマンスが低下
- サイズ制限を超えるエンティティを保存すると失敗する - Storage では 1MB 未満、Cosmos では 2MB 未満に抑える