当前位置: 首页 > news >正文

墓园网站建设价格婚恋网站如何做推广

墓园网站建设价格,婚恋网站如何做推广,中国建设银行网站下载安装,百度免费注册在这篇文章中#xff0c;我们将使用java方法在DynamoDB数据库上创建表。 在开始之前#xff0c;我们需要安装本地dynamodb#xff0c;因为我们要避免使用dynamodb的任何费用。 有一个以前的岗位上本地dynamodb。 如果您使用docker#xff0c;则可以找到本地dynamodb映像我们将使用java方法在DynamoDB数据库上创建表。 在开始之前我们需要安装本地dynamodb因为我们要避免使用dynamodb的任何费用。 有一个以前的岗位上本地dynamodb。 如果您使用docker则可以找到本地dynamodb映像也可以按照此处所述自行创建一个。 dynamodb java sdk使我们能够使用java代码创建dynamodb表。 最基本的操作是使用哈希键创建表。 在这种情况下用户的电子邮件将是哈希密钥。 ListKeySchemaElement elements new ArrayListKeySchemaElement();KeySchemaElement keySchemaElement new KeySchemaElement().withKeyType(KeyType.HASH).withAttributeName(email);elements.add(keySchemaElement);ListAttributeDefinition attributeDefinitions new ArrayList();attributeDefinitions.add(new AttributeDefinition().withAttributeName(email).withAttributeType(ScalarAttributeType.S));CreateTableRequest createTableRequest new CreateTableRequest().withTableName(Users).withKeySchema(elements).withProvisionedThroughput(new ProvisionedThroughput().withReadCapacityUnits(5L).withWriteCapacityUnits(5L)).withAttributeDefinitions(attributeDefinitions);amazonDynamoDB.createTable(createTableRequest); 我们所做的是使用他的电子邮件作为哈希键创建Users表。 下表称为“登录名”。 每次用户登录时登录都应保持跟踪。除了使用哈希键之外我们还将使用范围键。 ListKeySchemaElement elements new ArrayListKeySchemaElement();KeySchemaElement hashKey new KeySchemaElement().withKeyType(KeyType.HASH).withAttributeName(email);KeySchemaElement rangeKey new KeySchemaElement().withKeyType(KeyType.RANGE).withAttributeName(timestamp);elements.add(hashKey);elements.add(rangeKey);ListAttributeDefinition attributeDefinitions new ArrayList();attributeDefinitions.add(new AttributeDefinition().withAttributeName(email).withAttributeType(ScalarAttributeType.S));attributeDefinitions.add(new AttributeDefinition().withAttributeName(timestamp).withAttributeType(ScalarAttributeType.N));CreateTableRequest createTableRequest new CreateTableRequest().withTableName(Logins).withKeySchema(elements).withProvisionedThroughput(new ProvisionedThroughput().withReadCapacityUnits(5L).withWriteCapacityUnits(5L)).withAttributeDefinitions(attributeDefinitions);amazonDynamoDB.createTable(createTableRequest); 通过使用电子邮件作为哈希键我们可以查询特定用户的登录名。 通过使用登录发生的日期作为范围键可以查找登录条目的排序或基于特定用户的登录日期执行高级查询。 但是在大多数情况下哈希键和范围键不足以满足我们的需求。 DynamoDB为我们提供了全局二级索引和本地二级索引。 我们将创建表SupervisorS。 Supervisor的哈希键将是他的名字。 主管将为公司工作。 该公司将成为我们的全球二级指数。 由于公司拥有多个工厂因此实地工厂将成为范围的关键。 ListKeySchemaElement elements new ArrayList();KeySchemaElement hashKey new KeySchemaElement().withKeyType(KeyType.HASH).withAttributeName(name);elements.add(hashKey);ListGlobalSecondaryIndex globalSecondaryIndices new ArrayList();ArrayListKeySchemaElement indexKeySchema new ArrayList();indexKeySchema.add(new KeySchemaElement().withAttributeName(company).withKeyType(KeyType.HASH)); //Partition keyindexKeySchema.add(new KeySchemaElement().withAttributeName(factory).withKeyType(KeyType.RANGE)); //Sort keyGlobalSecondaryIndex factoryIndex new GlobalSecondaryIndex().withIndexName(FactoryIndex).withProvisionedThroughput(new ProvisionedThroughput().withReadCapacityUnits((long) 10).withWriteCapacityUnits((long) 1)).withKeySchema(indexKeySchema).withProjection(new Projection().withProjectionType(ProjectionType.ALL));globalSecondaryIndices.add(factoryIndex);ListAttributeDefinition attributeDefinitions new ArrayList();attributeDefinitions.add(new AttributeDefinition().withAttributeName(name).withAttributeType(ScalarAttributeType.S));attributeDefinitions.add(new AttributeDefinition().withAttributeName(company).withAttributeType(ScalarAttributeType.S));attributeDefinitions.add(new AttributeDefinition().withAttributeName(factory).withAttributeType(ScalarAttributeType.S));CreateTableRequest createTableRequest new CreateTableRequest().withTableName(Supervisors).withKeySchema(elements).withProvisionedThroughput(new ProvisionedThroughput().withReadCapacityUnits(5L).withWriteCapacityUnits(5L)).withGlobalSecondaryIndexes(factoryIndex).withAttributeDefinitions(attributeDefinitions);amazonDynamoDB.createTable(createTableRequest); 下一个表将是公司表。 哈希键将是母公司范围键将是子公司。 每个公司都有一位首席执行官。 CEO将是本地二级索引的范围键。 ListKeySchemaElement elements new ArrayList();KeySchemaElement hashKey new KeySchemaElement().withKeyType(KeyType.HASH).withAttributeName(name);KeySchemaElement rangeKey new KeySchemaElement().withKeyType(KeyType.RANGE).withAttributeName(subsidiary);elements.add(hashKey);elements.add(rangeKey);ListLocalSecondaryIndex localSecondaryIndices new ArrayList();ArrayListKeySchemaElement indexKeySchema new ArrayList();indexKeySchema.add(new KeySchemaElement().withAttributeName(name).withKeyType(KeyType.HASH));indexKeySchema.add(new KeySchemaElement().withAttributeName(ceo).withKeyType(KeyType.RANGE));LocalSecondaryIndex ceoIndex new LocalSecondaryIndex().withIndexName(CeoIndex).withKeySchema(indexKeySchema).withProjection(new Projection().withProjectionType(ProjectionType.ALL));localSecondaryIndices.add(ceoIndex);ListAttributeDefinition attributeDefinitions new ArrayList();attributeDefinitions.add(new AttributeDefinition().withAttributeName(name).withAttributeType(ScalarAttributeType.S));attributeDefinitions.add(new AttributeDefinition().withAttributeName(subsidiary).withAttributeType(ScalarAttributeType.S));attributeDefinitions.add(new AttributeDefinition().withAttributeName(ceo).withAttributeType(ScalarAttributeType.S));CreateTableRequest createTableRequest new CreateTableRequest().withTableName(Companies).withKeySchema(elements).withProvisionedThroughput(new ProvisionedThroughput().withReadCapacityUnits(5L).withWriteCapacityUnits(5L)).withLocalSecondaryIndexes(localSecondaryIndices).withAttributeDefinitions(attributeDefinitions);amazonDynamoDB.createTable(createTableRequest); 您可以在github上找到源代码。 翻译自: https://www.javacodegeeks.com/2016/06/create-dynamodb-tables-java.html
http://wiki.neutronadmin.com/news/136144/

相关文章:

  • 网站怎么换模板wordpress 评论 瀑布
  • 天长街道两学一做网站网站编辑楼盘详情页怎么做
  • 天水网站建设工程管理专业后悔死了
  • 类似返利网的网站建设wordpress转代码
  • 荆州市住房和城乡建设厅官方网站阿里巴巴电脑版
  • 江苏省住房和建设部网站首页wordpress 栏目插件
  • 介绍美食的网站模板好看网站
  • 深圳做手机商城网站建设网站后台管理系统栏目位置
  • 网站建设的公司选择哪家好wordpress图片主
  • 龙口网站开发汽车类网站建设预算
  • 网站看不到排版怎么办口碑营销是什么
  • 南充市建设局网站互联网科技公司做网站哪家好
  • 怎么做网站的关键词库采购平台app
  • 云南省红河州蒙自建设局网站小域名 网站备案
  • 宠物网站开发抖音seo教程
  • 网站是怎么做出来的720全景网站怎么做
  • 成都建设材料二维码网站大连市建设部网站官网
  • 织梦网站模板制作网站中文域名要到期
  • 花都区手机版网站建设wordpress支持的语言
  • 做音乐网站要注意什么网站建设的费用入账
  • 新东家网站建设织梦怎么制作网站
  • 用哪个网站做首页好南宁网站优化
  • 企业网站开发费用如何在百度上建立网站
  • 网站建设分几类搜网站网
  • 深圳 网站设计公司商标在线设计
  • 网站专题特点临潼区建设局网站
  • 兵团住房和城乡建设局网站wordpress 爬虫插件
  • 关于集团网站建设申请沈阳恢复营业通知
  • 网站建设国内现状施工企业安全生产评价标准
  • 做网站没流量丈哥seo博客工具