当前位置: 首页>>代码示例>>Java>>正文


Java KeyType.HASH属性代码示例

本文整理汇总了Java中com.amazonaws.services.dynamodbv2.model.KeyType.HASH属性的典型用法代码示例。如果您正苦于以下问题:Java KeyType.HASH属性的具体用法?Java KeyType.HASH怎么用?Java KeyType.HASH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.amazonaws.services.dynamodbv2.model.KeyType的用法示例。


在下文中一共展示了KeyType.HASH属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: recordSizeViolation

/** For GSI Violation value, should store them with their attribute type */
protected void recordSizeViolation(AttributeValue keyValue, int size, KeyType keyType) {
    if (keyType == KeyType.HASH) {
        if (recordGsiValueInViolationRecord) {
            violationRecord.setGSIHashKey(AttributeValueConverter.toStringWithAttributeType(keyValue));
        }
        violationRecord.setGSIHashKeyViolationType(SIZE_VIOLATION);
        violationRecord.setGSIHashKeyViolationDesc("Max Bytes Allowed: " + MAX_HASH_KEY_SIZE + " Found: " + size);
    } else if (keyType == KeyType.RANGE) {
        if (recordGsiValueInViolationRecord) {
            violationRecord.setGSIRangeKey(AttributeValueConverter.toStringWithAttributeType(keyValue));
        }
        violationRecord.setGSIRangeKeyViolationType(SIZE_VIOLATION);
        violationRecord.setGSIRangeKeyViolationDesc("Max Bytes Allowed: " + MAX_RANGE_KEY_SIZE + " Found: " + size);
    }
}
 
开发者ID:awslabs,项目名称:dynamodb-online-index-violation-detector,代码行数:16,代码来源:ViolationChecker.java

示例2: recordTypeViolation

protected void recordTypeViolation(AttributeValue keyValue, KeyType keyType, String expectedDatatype, String foundDatatype) {
    if (keyType == KeyType.HASH) {
        if (recordGsiValueInViolationRecord) {
            violationRecord.setGSIHashKey(AttributeValueConverter.toStringWithAttributeType(keyValue));
        }
        violationRecord.setGSIHashKeyViolationType(TYPE_VIOLATION);
        violationRecord.setGSIHashKeyViolationDesc("Expected: " + expectedDatatype + " Found: " + foundDatatype);
    } else {
        if (recordGsiValueInViolationRecord) {
            violationRecord.setGSIRangeKey(AttributeValueConverter.toStringWithAttributeType(keyValue));
        }
        violationRecord.setGSIRangeKeyViolationType(TYPE_VIOLATION);
        violationRecord.setGSIRangeKeyViolationDesc("Expected: " + expectedDatatype + " Found: " + foundDatatype);
    }
}
 
开发者ID:awslabs,项目名称:dynamodb-online-index-violation-detector,代码行数:15,代码来源:ViolationChecker.java

示例3: setKeySchema

/**
 * Sets the hash key schema for the specified table
 *
 * @param tableName
 * @param keyName
 * @param keyType
 */
public void setKeySchema(String tableName, String keyName, String keyType) {
  ArrayList<KeySchemaElement> kSchema = tablesToKeySchemas.get(tableName);
  if (kSchema == null) {
    kSchema = new ArrayList<KeySchemaElement>();
    tablesToKeySchemas.put(tableName, kSchema);
  }
  KeyType type = keyType.equals(DYNAMO_KEY_HASHRANGE) ? KeyType.RANGE : KeyType.HASH;
  kSchema.add(new KeySchemaElement().withAttributeName(keyName)
      .withKeyType(type));
}
 
开发者ID:apache,项目名称:gora,代码行数:17,代码来源:DynamoDBMapping.java

示例4: getKeyType

private KeyType getKeyType(String remarks) {
    if ("RANGE".equals(remarks)) {
        // default
        return KeyType.RANGE;
    }
    return KeyType.HASH;
}
 
开发者ID:apache,项目名称:metamodel,代码行数:7,代码来源:DynamoDbTableCreationBuilder.java


注:本文中的com.amazonaws.services.dynamodbv2.model.KeyType.HASH属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。