class AbstractDynamoDao extends AbstractDao<M,P,K,I> {

    public void ensureIndexes() {
        TableDescription desc = getTable().describe();
        List<AttributeDefinition> actualAttribs = desc.getAttributeDefinitions();
        List<GlobalSecondaryIndexDescription> actualIndexes = desc.getGlobalSecondaryIndexes();

        List<AttributeDefinition> desiredAttribs = getAttributeDefinitions();
        List<GlobalSecondaryIndex> desiredIndexes = getGlobalSecondaryIndexes();
        for (GlobalSecondaryIndex index : desiredIndexes) {
            if (!checkIndex(actualIndexes, index)) {
                CreateGlobalSecondaryIndexAction create = new CreateGlobalSecondaryIndexAction()
                        .withIndexName(index.getIndexName())
                        .withKeySchema(index.getKeySchema())
                        .withProvisionedThroughput(index.getProvisionedThroughput())
                        .withProjection(index.getProjection());
                AttributeDefinition attrHash = getAttribute(desiredAttribs, index.getKeySchema(), KeyType.HASH);
                AttributeDefinition attrRange = getAttribute(desiredAttribs, index.getKeySchema(), KeyType.RANGE);
                Index created;
                if (attrRange == null) {
                    created = getTable().createGSI(create, attrHash);
                } else {
                    created = getTable().createGSI(create, attrHash, attrRange);
                }
                try {
                    created.waitForActive();
                } catch (InterruptedException e) {
                    LOGGER.warn("InterruptedException while waiting for index creation: " + created, e);
                }
            }
        }
    }

    public  AbstractDynamoDao(Class<M> modelClass, Class<P> partialClass, AmazonDynamoDB db, String tableName);
    public  AbstractDynamoDao(Class<M> modelClass, Class<P> partialClass, AmazonDynamoDB db, String tableName, ItemMapper<M> modelMapper, ItemMapper<P> partialMapper);

}