Creates a table in AWS DynamoDB.
@param appid name of the {@link com.erudika.para.core.App}
@param readCapacity read capacity
@param writeCapacity write capacity
@return true if created
505255
public static boolean createTable(String appid, long readCapacity, long writeCapacity) {
		if (StringUtils.isBlank(appid)) {
			return false;
		} else if (StringUtils.containsWhitespace(appid)) {
			logger.warn("DynamoDB table name contains whitespace. The name '{}' is invalid.", appid);
			return false;
		} else if (existsTable(appid)) {
			logger.warn("DynamoDB table '{}' already exists.", appid);
			return false;
		}
		try {
			String table = getTableNameForAppid(appid);
			getClient().createTable(new CreateTableRequest().withTableName(table).
					withKeySchema(new KeySchemaElement(Config._KEY, KeyType.HASH)).
					withSSESpecification(new SSESpecification().withEnabled(ENCRYPTION_AT_REST_ENABLED)).
					withAttributeDefinitions(new AttributeDefinition(Config._KEY, ScalarAttributeType.S)).
					withProvisionedThroughput(new ProvisionedThroughput(readCapacity, writeCapacity)));
			logger.info("Created DynamoDB table '{}'.", table);
		} catch (Exception e) {
			logger.error(null, e);
			return false;
		}
		return true;
	}
267507
private boolean volumeCreated(String volumeId) {
		DescribeVolumesRequest dvs = new DescribeVolumesRequest();
		ArrayList<String> volumeIds = new ArrayList<String>();
		volumeIds.add(volumeId);
		dvs.setVolumeIds(volumeIds);
		DescribeVolumesResult dvsresult = null;
		try {
			dvsresult = this.ec2Api.describeVolumes(dvs);
		} catch(Exception e) {
			dvsresult = null;
		}

		return dvsresult != null && "available".equals(dvsresult.getVolumes().get(0).getState());
	}
947656
public boolean authenticate(String appId, String apiKey) throws MnoConfigurationException {
		return appId != null && apiKey != null && appId.equals(api.getId()) && apiKey.equals(api.getKey());
	}
813104
private void setDefaultCapacity() {
        Object capacity = getParam("ddb_default_read_capacity"); 
        if (capacity != null) {
            READ_CAPACITY_UNITS = Integer.parseInt(capacity.toString());
        }
        capacity = getParam("ddb_default_write_capacity");
        if (capacity != null) {
            WRITE_CAPACITY_UNITS = Integer.parseInt(capacity.toString());
        }
        m_logger.info("Default table capacity: read={}, write={}", READ_CAPACITY_UNITS, WRITE_CAPACITY_UNITS);
    }
18021
function writeSeeds(dynamodbWriteFunction, tableName, seeds) {
  if (!dynamodbWriteFunction) {
    throw new Error("dynamodbWriteFunction argument must be provided");
  }
  if (!tableName) {
    throw new Error("table name argument must be provided");
  }
  if (!seeds) {
    throw new Error("seeds argument must be provided");
  }

  if (seeds.length > 0) {
    const seedChunks = _.chunk(seeds, MAX_MIGRATION_CHUNK);
    return BbPromise.map(
      seedChunks,
      (chunk) => writeSeedBatch(dynamodbWriteFunction, tableName, chunk),
      { concurrency: MIGRATION_SEED_CONCURRENCY }
    )
      .then(() => console.log("Seed running complete for table: " + tableName));
  }
}
423406
@Override
	public void createResource() throws Exception {
		cluster = builder.getCluster();
		session = cluster.connect();

		session.execute(String.format("CREATE KEYSPACE IF NOT EXISTS %s with replication={'class':'SimpleStrategy', 'replication_factor':1};", keySpace));
		session.execute(String.format("CREATE TABLE IF NOT EXISTS %s.%s (sink_id text, sub_id int, checkpoint_id bigint, PRIMARY KEY (sink_id, sub_id));", keySpace, table));

		try {
			session.close();
		} catch (Exception e) {
			LOG.error("Error while closing session.", e);
		}
		try {
			cluster.close();
		} catch (Exception e) {
			LOG.error("Error while closing cluster.", e);
		}
	}
1088904
public boolean createTableIfMissing (Connection conn, String table, List<String> columns,
                                         List<ColumnDefinition> declarations,
                                         List<String> primaryKeyColumns) throws SQLException {
        return createTableIfMissing(conn, table, columns, declarations, null, primaryKeyColumns);
    }
350565
def createDdbTable(region=None, table="credential-store", **kwargs):
    '''
    
    '''
    session = get_session(**kwargs)
    dynamodb = session.resource("dynamodb", region_name=region)
    if table in (t.name for t in dynamodb.tables.all()):
        print("Credential Store table already exists")
        return

    print("Creating table...")
    dynamodb.create_table(
        TableName=table,
        KeySchema=[
            {
                "AttributeName": "name",
                "KeyType": "HASH",
            },
            {
                "AttributeName": "version",
                "KeyType": "RANGE",
            }
        ],
        AttributeDefinitions=[
            {
                "AttributeName": "name",
                "AttributeType": "S",
            },
            {
                "AttributeName": "version",
                "AttributeType": "S",
            },
        ],
        ProvisionedThroughput={
            "ReadCapacityUnits": 1,
            "WriteCapacityUnits": 1,
        }
    )

    print("Waiting for table to be created...")
    client = session.client("dynamodb", region_name=region)

    response = client.describe_table(TableName=table)

    client.get_waiter("table_exists").wait(TableName=table)

    print("Adding tag...")

    client.tag_resource(
        ResourceArn=response["Table"]["TableArn"],
        Tags=[
            {
                'Key': "Name",
                'Value': "credstash"
            },
        ]
    )

    print("Table has been created. "
          "Go read the README about how to create your KMS key")
921048
@Override
    public Put createPut(Record record, String tableName,
            String famName, String quaName) throws IOException {
        HTable hTable = getTable(tableName);
        Put put = null;
        if (hTable != null) {
            // Transforming data model record into an Avro record
            AvroSerializer serializer = getSerializer();
            final byte[] bytes = serializer.toBytes(record);
            // Resource's Key
            put = new Put(Bytes.toBytes(record.getID().toString()));
            // Resource's Value
            put.add(Bytes.toBytes(famName), Bytes.toBytes(quaName), bytes);
        }
        return put;
    }
351318
def get_provisioned_gsi_write_units(table_name, gsi_name):
    
    try:
        desc = DYNAMODB_CONNECTION.describe_table(table_name)
    except JSONResponseError:
        raise

    for gsi in desc[u'Table'][u'GlobalSecondaryIndexes']:
        if gsi[u'IndexName'] == gsi_name:
            write_units = int(
                gsi[u'ProvisionedThroughput'][u'WriteCapacityUnits'])
            break

    logger.debug(
        '{0} - GSI: {1} - Currently provisioned write units: {2:d}'.format(
            table_name, gsi_name, write_units))
    return write_units
531324
function AzureTableStorage(config) {
        // Store node for further use
        node = this;
        nodeConfig = config;

        // Create the Node-RED node
        RED.nodes.createNode(this, config);
        clientAccountName = node.credentials.accountname
        clientAccountKey = node.credentials.key;

        this.on('input', function (msg) {

            var messageJSON = null;

            if (typeof (msg.payload) != "string") {
                node.log("JSON");
                messageJSON = msg.payload;
            } else {
                node.log("String");
                //Converting string to JSON Object if msg.payload is String
                //Sample string: {"tableName": "name", "action": "I" "partitionKey": "part1", "rowKey": "row1", "data": "data"}
                messageJSON = JSON.parse(msg.payload);
            }

            entityClass = messageJSON;
            //var tableselect = createTable(messageJSON.tableName);
            node.log('Received the input: ' + messageJSON.tableName);
            var action = messageJSON.action;
            // Sending data to Azure Table Storage
            setStatus(statusEnum.sending);
            switch (action) {
                case "I":
                    node.log('Trying to insert entity');
                    createTable(senddata);
                    break;
                case "R":
                    node.log('Trying to read entity');
                    createTable(readdata);
                    break;
                case "DT":
                    node.log('Trying to delete table');
                    deleteTable(entityClass.tableName);
                    break;
                case "Q":
                    //node.log('Trying to query data');
                    //queryEntity(messageJSON.tableName, messageJSON.fromColumn, messageJSON.where, messageJSON.selectData);
                    break;
                case "U":
                    node.log('trying to update entity');
                    createTable(uptadeEntity);
                    break;
                case "D":
                    node.log('trying to delete entity');
                    createTable(deleteEntity);
                    break;
                default:
                    node.log('action was not detected');
                    node.error('action was not detected');
                    setStatus(statusEnum.error);
                    break;
            }    
        });

        this.on('close', function () {
            disconnectFrom(this);
        });
    }
1042527
private TableDDL createTableDDL(String tableName) {
        TableMetadata tableMetadata = _keyspace.getKeyspaceMetadata().getTable(tableName);
        String rowKeyColumnName = tableMetadata.getPrimaryKey().get(0).getName();
        String timeSeriesColumnName = tableMetadata.getPrimaryKey().get(1).getName();
        String valueColumnName = tableMetadata.getColumns().get(2).getName();

        return new TableDDL(tableMetadata, rowKeyColumnName, timeSeriesColumnName, valueColumnName);
    }
177640
public static BigtableTableAdminClient create(
      @Nonnull String projectId, @Nonnull String instanceId) throws IOException {
    return create(
        BigtableTableAdminSettings.newBuilder()
            .setProjectId(projectId)
            .setInstanceId(instanceId)
            .build());
  }
946451
public Observable<ServiceResponse<PublishSettings>> getPublishSettingsWithServiceResponseAsync(UUID appId) {
        if (this.client.endpoint() == null) {
            throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
        }
        if (appId == null) {
            throw new IllegalArgumentException("Parameter appId is required and cannot be null.");
        }
        String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint());
        return service.getPublishSettings(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PublishSettings>>>() {
                @Override
                public Observable<ServiceResponse<PublishSettings>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PublishSettings> clientResponse = getPublishSettingsDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
37742
public static Map<String, Object> getTableStatus(final String appid) {
		if (StringUtils.isBlank(appid)) {
			return Collections.emptyMap();
		}
		try {
			final TableDescription td = getClient().describeTable(getTableNameForAppid(appid)).getTable();
			HashMap<String, Object> dbStatus = new HashMap<>();
			dbStatus.put("id", appid);
			dbStatus.put("status", td.getTableStatus());
			dbStatus.put("created", td.getCreationDateTime().getTime());
			dbStatus.put("sizeBytes", td.getTableSizeBytes());
			dbStatus.put("itemCount", td.getItemCount());
			dbStatus.put("readCapacityUnits", td.getProvisionedThroughput().getReadCapacityUnits());
			dbStatus.put("writeCapacityUnits", td.getProvisionedThroughput().getWriteCapacityUnits());
			return dbStatus;
		} catch (Exception e) {
			logger.error(null, e);
		}
		return Collections.emptyMap();
	}
105624
public void createTicketTables(final boolean deleteTables) {
        val metadata = this.ticketCatalog.findAll();
        metadata.forEach(Unchecked.consumer(r -> {
            val request = new CreateTableRequest()
                .withAttributeDefinitions(new AttributeDefinition(ColumnNames.ID.getColumnName(), ScalarAttributeType.S))
                .withKeySchema(new KeySchemaElement(ColumnNames.ID.getColumnName(), KeyType.HASH))
                .withProvisionedThroughput(new ProvisionedThroughput(dynamoDbProperties.getReadCapacity(),
                    dynamoDbProperties.getWriteCapacity())).withTableName(r.getProperties().getStorageName());
            if (deleteTables) {
                val delete = new DeleteTableRequest(r.getProperties().getStorageName());
                LOGGER.debug("Sending delete request [{}] to remove table if necessary", delete);
                TableUtils.deleteTableIfExists(amazonDynamoDBClient, delete);
            }
            LOGGER.debug("Sending delete request [{}] to create table", request);
            TableUtils.createTableIfNotExists(amazonDynamoDBClient, request);
            LOGGER.debug("Waiting until table [{}] becomes active...", request.getTableName());
            TableUtils.waitUntilActive(amazonDynamoDBClient, request.getTableName());
            val describeTableRequest = new DescribeTableRequest().withTableName(request.getTableName());
            LOGGER.debug("Sending request [{}] to obtain table description...", describeTableRequest);
            val tableDescription = amazonDynamoDBClient.describeTable(describeTableRequest).getTable();
            LOGGER.debug("Located newly created table with description: [{}]", tableDescription);
        }));
    }
61435
public void write(DataOutput out) throws IOException {
    out.writeInt(appId.length);
    out.write(appId);
    out.writeInt(maxCount);
  }