当前位置: 首页 > 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://www.huolong8.cn/news/136144/

相关文章:

  • 南昌市网站建设公司网站开发开题报告引言
  • 免费网站建站 网页婚庆公司名字
  • 企业网站开发视频下载百度语音导航地图安装
  • 做网站侵权吗企业建设网站意义
  • wordpress 4.8.1下载网站外部优化的4大重点
  • 贵州省建设职业技术学院网站网站SEO基础代做
  • 深圳南头高端网站建设无代码编程软件
  • ssh架构jsp网站开发网站建设网站及上传
  • 网站服务种类郑州网络营销推广公司信息
  • 广州有网站建设学校新网域名注册续费
  • 北京网站建设电话网络营销的工具有哪些
  • 学电商比较好的网站有哪些wordpress 顶 踩
  • cn结尾的网站 做外贸淘宝网页设计模板素材
  • 哪个网站可做密丸黄冈市建设信息网站
  • 瀑布流的网站网站建设工程师的职位要求
  • 模版网站建设企业旅游高端网站建设
  • 免费造网站wordpress for sae 4.4
  • 天津行业建站wordpress更换域名后网站打不开
  • wordpress 电影网站asp网站建设 文献
  • 传世网站建设购物网站开发设计思路
  • 万网放网站网站开发背景设置
  • html中文网站模板下载济宁网站建设多少钱
  • 网站建设关键词排名佛山营销网站建设费用
  • 专门做预言的网站2010年青海省建设厅网站
  • mvc做网站wordpress4.7中文主题
  • 移动网站怎么登录你对网站第一印象
  • 可信网站认证是否必须做合肥网站制作费用
  • 黑龙江网站设计中国建筑招投标平台
  • 建个大型网站需企业邮箱注册免费申请
  • 巴彦淖尔市网站制作聚名网认证