<bdo id='hwLCp'></bdo><ul id='hwLCp'></ul>
    1. <i id='hwLCp'><tr id='hwLCp'><dt id='hwLCp'><q id='hwLCp'><span id='hwLCp'><b id='hwLCp'><form id='hwLCp'><ins id='hwLCp'></ins><ul id='hwLCp'></ul><sub id='hwLCp'></sub></form><legend id='hwLCp'></legend><bdo id='hwLCp'><pre id='hwLCp'><center id='hwLCp'></center></pre></bdo></b><th id='hwLCp'></th></span></q></dt></tr></i><div id='hwLCp'><tfoot id='hwLCp'></tfoot><dl id='hwLCp'><fieldset id='hwLCp'></fieldset></dl></div>

      <small id='hwLCp'></small><noframes id='hwLCp'>

        <legend id='hwLCp'><style id='hwLCp'><dir id='hwLCp'><q id='hwLCp'></q></dir></style></legend>

        <tfoot id='hwLCp'></tfoot>

        DynamoDB 和 TableNameOverride 带前缀

        DynamoDB and TableNameOverride with prefix(DynamoDB 和 TableNameOverride 带前缀)

        <tfoot id='TMLba'></tfoot>
          <i id='TMLba'><tr id='TMLba'><dt id='TMLba'><q id='TMLba'><span id='TMLba'><b id='TMLba'><form id='TMLba'><ins id='TMLba'></ins><ul id='TMLba'></ul><sub id='TMLba'></sub></form><legend id='TMLba'></legend><bdo id='TMLba'><pre id='TMLba'><center id='TMLba'></center></pre></bdo></b><th id='TMLba'></th></span></q></dt></tr></i><div id='TMLba'><tfoot id='TMLba'></tfoot><dl id='TMLba'><fieldset id='TMLba'></fieldset></dl></div>

            <tbody id='TMLba'></tbody>

          <small id='TMLba'></small><noframes id='TMLba'>

                <legend id='TMLba'><style id='TMLba'><dir id='TMLba'><q id='TMLba'></q></dir></style></legend>
                • <bdo id='TMLba'></bdo><ul id='TMLba'></ul>
                • 本文介绍了DynamoDB 和 TableNameOverride 带前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在测试 DynamoDB 表,并希望使用前缀dev_"为 prod 和 dev 环境设置不同的表名以进行开发.

                  I am testing DynamoDB tables and want to set up different table names for prod and dev environment using the prefix "dev_" for development.

                  我做了这个测试来打印表名:

                  I made this test to print the table name:

                  import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig.TableNameOverride;  
                  
                  TableNameOverride tbl = new TableNameOverride("test").withTableNamePrefix("dev_");
                  System.out.println("name=" + tbl.getTableName() + "  prefix=" + tbl.getTableNamePrefix());
                  

                  这打印:name=null prefix=dev_
                  这里的名字怎么是空的?

                  This prints: name=null prefix=dev_
                  How come the name here is null ?

                  TableNameOverride tbl = new TableNameOverride("test");//.withTableNamePrefix("dev_");
                  System.out.println("name=" + tbl.getTableName() + "  prefix=" + tbl.getTableNamePrefix());
                  

                  这打印:name=test prefix=null

                  *如何让表名成为dev_test"?*

                  我想稍后使用它为开发模式下的所有表获取dev_"前缀,如下所示:

                  I want to use this later to get a "dev_" prefix for all tables in development mode like this:

                  DynamoDBTable annotation = (DynamoDBTable) myclass.getClass().getAnnotation(DynamoDBTable.class);  
                  TableNameOverride tbl = new TableNameOverride(annotation.tableName()).withTableNamePrefix("dev_");
                  

                  或者是否有另一种解决方案来分隔 dev 表和 prod 表?
                  我首先想到将它们放在不同的区域,但不确定.

                  Or is there another solution to separate between dev and prod tables?
                  I first thought of putting them in separate regions but not sure about this.

                  也可以这样用:

                  mapper.save(ck, new DynamoDBMapperConfig(new TableNameOverride((isDev ? "dev_" : "") + annotation.tableName())));
                  

                  推荐答案

                  withTableNamePrefix 是一个静态方法.因此,这一行使用字符串test"创建 TableNameOverride 的新实例,然后通过调用静态 withTableNamePrefix 方法将该实例丢弃:

                  withTableNamePrefix is a static method. So this line is creating a new instance of TableNameOverride with the String "test", and then throwing that instance away by using it to call the static withTableNamePrefix method:

                  TableNameOverride tbl = new TableNameOverride("test").withTableNamePrefix("dev_");
                  

                  要回答将测试与生产分开的更深层次的问题,我建议完全拥有 2 个单独的 AWS 账户,一个用于开发,一个用于生产.这是您可以做到的唯一方法:

                  To answer the deeper question of separating test from prod, I would recommend having 2 separate AWS Accounts entirely, one for dev and one for prod. This is the only way you can:

                  • 单独查看帐单
                  • 确保您绝不在产品和测试系统之间泄露数据
                  • 在 dev 表上进行高扩展会阻止您将 prod 表扩展得更高
                  • See billing separately
                  • Ensure you never leak data between prod and test systems
                  • Have high scaling on a dev table prevent you from scaling a prod table higher

                  这篇关于DynamoDB 和 TableNameOverride 带前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Lucene Porter Stemmer not public(Lucene Porter Stemmer 未公开)
                  How to index pdf, ppt, xl files in lucene (java based or python or php any of these is fine)?(如何在 lucene 中索引 pdf、ppt、xl 文件(基于 java 或 python 或 php 中的任何一个都可以)?)
                  KeywordAnalyzer and LowerCaseFilter/LowerCaseTokenizer(KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer)
                  How to search between dates (Hibernate Search)?(如何在日期之间搜索(休眠搜索)?)
                  How to get positions from a document term vector in Lucene?(如何从 Lucene 中的文档术语向量中获取位置?)
                  Java Lucene 4.5 how to search by case insensitive(Java Lucene 4.5如何按不区分大小写进行搜索)
                  <legend id='Mck6I'><style id='Mck6I'><dir id='Mck6I'><q id='Mck6I'></q></dir></style></legend>
                • <small id='Mck6I'></small><noframes id='Mck6I'>

                      • <bdo id='Mck6I'></bdo><ul id='Mck6I'></ul>
                        <i id='Mck6I'><tr id='Mck6I'><dt id='Mck6I'><q id='Mck6I'><span id='Mck6I'><b id='Mck6I'><form id='Mck6I'><ins id='Mck6I'></ins><ul id='Mck6I'></ul><sub id='Mck6I'></sub></form><legend id='Mck6I'></legend><bdo id='Mck6I'><pre id='Mck6I'><center id='Mck6I'></center></pre></bdo></b><th id='Mck6I'></th></span></q></dt></tr></i><div id='Mck6I'><tfoot id='Mck6I'></tfoot><dl id='Mck6I'><fieldset id='Mck6I'></fieldset></dl></div>
                        <tfoot id='Mck6I'></tfoot>

                          <tbody id='Mck6I'></tbody>