Tabnine Logo
CloudTable.createIfNotExists
Code IndexAdd Tabnine to your IDE (free)

How to use
createIfNotExists
method
in
com.microsoft.azure.storage.table.CloudTable

Best Java code snippets using com.microsoft.azure.storage.table.CloudTable.createIfNotExists (Showing top 20 results out of 315)

origin: brianfrankcooper/YCSB

try {
 cloudTable = tableClient.getTableReference(table);
 cloudTable.createIfNotExists();
} catch (Exception e)  {
 throw new DBException("Could not connect to the table.\n", e);
origin: google/data-transfer-project

public void init() {
 try {
  String endpoint = String.format(ENDPOINT_TEMPLATE, configuration.getAccountName());
  CloudStorageAccount cosmosAccount =
    CloudStorageAccount.parse(
      String.format(
        COSMOS_CONNECTION_TEMPLATE,
        configuration.getAccountName(),
        configuration.getAccountKey(),
        endpoint));
  tableClient = cosmosAccount.createCloudTableClient();
  // Create the tables if the do not exist
  tableClient.getTableReference(JOB_TABLE).createIfNotExists();
  tableClient.getTableReference(JOB_DATA_TABLE).createIfNotExists();
  CloudStorageAccount blobAccount =
    CloudStorageAccount.parse(
      String.format(
        BLOB_CONNECTION_TEMPLATE,
        configuration.getAccountName(),
        configuration.getBlobKey()));
  blobClient = blobAccount.createCloudBlobClient();
  blobClient.getContainerReference(BLOB_CONTAINER).createIfNotExists();
 } catch (StorageException | URISyntaxException | InvalidKeyException e) {
  throw new MicrosoftStorageException(e);
 }
}
origin: yammer/breakerbox

public void create(AzureTableName table) {
  try {
    tableRefrence(table).createIfNotExists();
    return;
  } catch (StorageException e) {
    LOG.warn("Error creating table: {}", table, e);
  }
  throw new IllegalStateException("Could not create table: " + table);
}
origin: com.microsoft.azure/azure-storage

/**
 * Creates the table in the storage service using default request options if it does not already exist.
 *
 * @return <code>true</code> if the table is created in the storage service; otherwise <code>false</code>.
 *
 * @throws StorageException
 *             If a storage service error occurred during the operation.
 */
@DoesServiceRequest
public boolean createIfNotExists() throws StorageException {
  return this.createIfNotExists(null /* options */, null /* opContext */);
}
origin: Azure/azure-storage-android

/**
 * Creates the table in the storage service using default request options if it does not already exist.
 *
 * @return <code>true</code> if the table is created in the storage service; otherwise <code>false</code>.
 *
 * @throws StorageException
 *             If a storage service error occurred during the operation.
 */
@DoesServiceRequest
public boolean createIfNotExists() throws StorageException {
  return this.createIfNotExists(null /* options */, null /* opContext */);
}
origin: HuygensING/timbuctoo

public AzureAccess(CloudTableClient client, String tableName) throws AzureAccessNotPossibleException {
 try {
  table = client.getTableReference(tableName);
  table.createIfNotExists();
 } catch (URISyntaxException | StorageException e) {
  LOG.error("Azure communication failed", e);
  throw new AzureAccessNotPossibleException("Azure communication failed");
 }
}
origin: apache/samza

public TableUtils(AzureClient client, String tableName, String initialState) {
 this.initialState = initialState;
 CloudTableClient tableClient = client.getTableClient();
 try {
  table = tableClient.getTableReference(tableName);
  table.createIfNotExists();
 } catch (URISyntaxException e) {
  LOG.error("\nConnection string specifies an invalid URI.", e);
  throw new AzureException(e);
 } catch (StorageException e) {
  LOG.error("Azure storage exception.", e);
  throw new AzureException(e);
 }
}
origin: apache/samza

@Override
public void start() {
 try {
  // Create the table if it doesn't exist.
  cloudTable = azureClient.getTableClient().getTableReference(jobTableName);
  cloudTable.createIfNotExists();
 } catch (URISyntaxException e) {
  LOG.error("Connection string {} specifies an invalid URI while creating checkpoint table.",
      storageConnectionString);
  throw new AzureException(e);
 } catch (StorageException e) {
  LOG.error("Azure Storage failed when creating checkpoint table", e);
  throw new AzureException(e);
 }
}
origin: opendedup/sdfs

public BlobDataIO(String tableName,String accessKey,String secretKey,String connectionProtocol) throws InvalidKeyException, URISyntaxException, StorageException {
  storageConnectionString="DefaultEndpointsProtocol=" + connectionProtocol + ";" + "AccountName="
      + accessKey + ";" + "AccountKey=" + secretKey;
  CloudStorageAccount storageAccount =
      CloudStorageAccount.parse(storageConnectionString);
  tableClient = storageAccount.createCloudTableClient();
  cloudTable = tableClient.getTableReference(tableName);
  cloudTable.createIfNotExists();
}

origin: Azure/azure-storage-android

@Before
public void tableSerializerTestMethodSetUp() throws URISyntaxException, StorageException {
  this.table = TableTestHelper.getRandomTableReference();
  this.table.createIfNotExists();
}
origin: Azure/azure-storage-android

@Before
public void tableEscapingTestMethodSetUp() throws URISyntaxException, StorageException {
  this.table = TableTestHelper.getRandomTableReference();
  this.table.createIfNotExists();
}
origin: Azure/azure-storage-android

@Before
public void tableBatchOperationTestMethodSetUp() throws URISyntaxException, StorageException {
  this.table = TableTestHelper.getRandomTableReference();
  this.table.createIfNotExists();
}
origin: Azure/azure-storage-android

@Before
public void tableOperationTestMethodSetUp() throws URISyntaxException, StorageException {
  this.table = TableTestHelper.getRandomTableReference();
  this.table.createIfNotExists();
}
origin: Azure/azure-storage-android

@Before
public void tableDateTestMethodSetUp() throws URISyntaxException, StorageException {
  this.table = TableTestHelper.getRandomTableReference();
  this.table.createIfNotExists();
}
origin: Azure/azure-storage-android

public void testTableQueryProjectionWithNull() throws URISyntaxException, StorageException {
  CloudTable table = TableTestHelper.getRandomTableReference();
  try {
    // Create a new table so we don't pollute the main query table
    table.createIfNotExists();
    // Insert an entity which is missing String and IntegerPrimitive
    DynamicTableEntity entity = new DynamicTableEntity(UUID.randomUUID().toString(), UUID.randomUUID()
        .toString());
    table.execute(TableOperation.insert(entity));
    testTableQueryProjectionWithSpecialCases(table);
  }
  finally {
    table.deleteIfExists();
  }
}
origin: Microsoft/azure-tools-for-java

@NotNull
public Table createTable(@NotNull StorageAccount storageAccount,
             @NotNull Table table)
    throws AzureCmdException {
  try {
    CloudTableClient client = getCloudTableClient(storageAccount);
    CloudTable cloudTable = client.getTableReference(table.getName());
    cloudTable.createIfNotExists();
    String uri = cloudTable.getUri() != null ? cloudTable.getUri().toString() : "";
    table.setUri(uri);
    return table;
  } catch (Throwable t) {
    throw new AzureCmdException("Error creating the Table", t);
  }
}
origin: Azure/azure-storage-android

@BeforeClass
public static void tableQueryTestMethodSetUp() throws Exception {
  table = TableTestHelper.getRandomTableReference();
  table.createIfNotExists();
  // Insert 500 entities in Batches to query
  for (int i = 0; i < 5; i++) {
    TableBatchOperation batch = new TableBatchOperation();
    for (int j = 0; j < 100; j++) {
      Class1 ent = TableTestHelper.generateRandomEntity("javatables_batch_" + Integer.toString(i));
      ent.setRowKey(String.format("%06d", j));
      batch.insert(ent);
    }
    table.execute(batch);
  }
}
origin: Azure/azure-storage-android

@Test
public void testTableCreateIfNotExists() throws StorageException, URISyntaxException {
  CloudTableClient tClient = TableTestHelper.createCloudTableClient();
  String tableName = TableTestHelper.generateRandomTableName();
  CloudTable table = tClient.getTableReference(tableName);
  try {
    assertTrue(table.createIfNotExists());
    assertTrue(table.exists());
    assertFalse(table.createIfNotExists());
  } finally {
    // cleanup
    table.deleteIfExists();
  }
}
origin: Azure/azure-storage-android

@Test
public void testTableDoesTableExist() throws StorageException, URISyntaxException {
  CloudTableClient tClient = TableTestHelper.createCloudTableClient();
  String tableName = TableTestHelper.generateRandomTableName();
  CloudTable table = tClient.getTableReference(tableName);
  try {
    assertFalse(table.exists());
    assertTrue(table.createIfNotExists());
    assertTrue(table.exists());
  } finally {
    // cleanup
    table.deleteIfExists();
  }
}
origin: Azure/azure-storage-android

@Test
public void testTableCreateExistsAndDelete() throws StorageException, URISyntaxException {
  CloudTableClient tClient = TableTestHelper.createCloudTableClient();
  String tableName = TableTestHelper.generateRandomTableName();
  CloudTable table = tClient.getTableReference(tableName);
  try {
    assertTrue(table.createIfNotExists());
    assertTrue(table.exists());
    assertTrue(table.deleteIfExists());
  } finally {
    // cleanup
    table.deleteIfExists();
  }
}
com.microsoft.azure.storage.tableCloudTablecreateIfNotExists

Javadoc

Creates the table in the storage service using default request options if it does not already exist.

Popular methods of CloudTable

  • execute
    Executes a query, using the specified TableRequestOptions and OperationContext. This method will in
  • deleteIfExists
    Deletes the table from the storage service using the specified request options and operation context
  • <init>
    Creates an instance of the CloudTable class using the specified table URI and credentials.
  • create
    Creates the table in the storage service, using the specified TableRequestOptions and OperationConte
  • delete
    Deletes the table from the storage service, using the specified request options and operation contex
  • exists
    Returns a value that indicates whether the table exists in the storage service, using the specified
  • getName
    Gets the name of the table.
  • downloadPermissions
    Downloads the permissions settings for the table using the specified request options and operation c
  • executeSegmented
    Executes a query in segmented mode with the specified ResultContinuation continuation token, using t
  • generateSharedAccessSignature
    Creates a shared access signature for the table.
  • getServiceClient
    Gets the table service client associated with this queue.
  • getStorageUri
    Returns the list of URIs for all locations.
  • getServiceClient,
  • getStorageUri,
  • uploadPermissions,
  • downloadPermissionsImpl,
  • getSharedAccessCanonicalName,
  • getUri,
  • parseQueryAndVerify,
  • uploadPermissionsImpl,
  • ExistsAsync

Popular in Java

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • getSystemService (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • BoxLayout (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now