This creates the first meta schema in an empty keyspace which has not been initialised yet

@param tx
337195
private void initialiseMetaConcepts(TransactionOLTP tx) {
        VertexElement type = tx.addTypeVertex(Schema.MetaSchema.THING.getId(), Schema.MetaSchema.THING.getLabel(), Schema.BaseType.TYPE);
        VertexElement entityType = tx.addTypeVertex(Schema.MetaSchema.ENTITY.getId(), Schema.MetaSchema.ENTITY.getLabel(), Schema.BaseType.ENTITY_TYPE);
        VertexElement relationType = tx.addTypeVertex(Schema.MetaSchema.RELATION.getId(), Schema.MetaSchema.RELATION.getLabel(), Schema.BaseType.RELATION_TYPE);
        VertexElement resourceType = tx.addTypeVertex(Schema.MetaSchema.ATTRIBUTE.getId(), Schema.MetaSchema.ATTRIBUTE.getLabel(), Schema.BaseType.ATTRIBUTE_TYPE);
        tx.addTypeVertex(Schema.MetaSchema.ROLE.getId(), Schema.MetaSchema.ROLE.getLabel(), Schema.BaseType.ROLE);
        tx.addTypeVertex(Schema.MetaSchema.RULE.getId(), Schema.MetaSchema.RULE.getLabel(), Schema.BaseType.RULE);

        relationType.property(Schema.VertexProperty.IS_ABSTRACT, true);
        resourceType.property(Schema.VertexProperty.IS_ABSTRACT, true);
        entityType.property(Schema.VertexProperty.IS_ABSTRACT, true);

        relationType.addEdge(type, Schema.EdgeLabel.SUB);
        resourceType.addEdge(type, Schema.EdgeLabel.SUB);
        entityType.addEdge(type, Schema.EdgeLabel.SUB);
    }
1109927
def create_tx(self, txins=None, txouts=None, lock_time=0):
        
        txins = [] if txins is None else txins
        txouts = [] if txouts is None else txouts
        lock_time = deserialize.positive_integer(lock_time)
        txins = deserialize.txins(txins)
        txouts = deserialize.txouts(self.testnet, txouts)
        tx = control.create_tx(self.service, self.testnet, txins, txouts,
                               lock_time=lock_time)
        return serialize.tx(tx)
93811
public static TransactionException transactionOpen(TransactionOLTP tx) {
        return create(ErrorMessage.TRANSACTION_ALREADY_OPEN.getMessage(tx.keyspace()));
    }
1320927
private void executeDelKeySpace(Tree statement)
            throws TException, InvalidRequestException, NotFoundException, SchemaDisagreementException
    {
        if (!CliMain.isConnected())
            return;

        String keyspaceName = CliCompiler.getKeySpace(statement, thriftClient.describe_keyspaces());
        String version = thriftClient.system_drop_keyspace(keyspaceName);
        sessionState.out.println(version);

        if (keyspaceName.equals(keySpace)) //we just deleted the keyspace we were authenticated too
            keySpace = null;
    }
1369805
protected void initSchema(String signature) throws IOException
    {
        Properties properties = UDFContext.getUDFContext().getUDFProperties(AbstractCassandraStorage.class);

        // Only get the schema if we haven't already gotten it
        if (!properties.containsKey(signature))
        {
            try
            {
                Cassandra.Client client = ConfigHelper.getClientFromInputAddressList(conf);
                client.set_keyspace(keyspace);

                if (username != null && password != null)
                {
                    Map<String, String> credentials = new HashMap<String, String>(2);
                    credentials.put(IAuthenticator.USERNAME_KEY, username);
                    credentials.put(IAuthenticator.PASSWORD_KEY, password);

                    try
                    {
                        client.login(new AuthenticationRequest(credentials));
                    }
                    catch (AuthenticationException e)
                    {
                        logger.error("Authentication exception: invalid username and/or password");
                        throw new IOException(e);
                    }
                    catch (AuthorizationException e)
                    {
                        throw new AssertionError(e); // never actually throws AuthorizationException.
                    }
                }

                // compose the CfDef for the columfamily
                CfInfo cfInfo = getCfInfo(client);

                if (cfInfo.cfDef != null)
                {
                    StringBuilder sb = new StringBuilder();
                    sb.append(cfInfo.compactCqlTable ? 1 : 0).append(cfInfo.cql3Table ? 1: 0).append(cfdefToString(cfInfo.cfDef));
                    properties.setProperty(signature, sb.toString());
                }
                else
                    throw new IOException(String.format("Column family '%s' not found in keyspace '%s'",
                                                             column_family,
                                                             keyspace));
            }
            catch (Exception e)
            {
                throw new IOException(e);
            }
        }
    }
572295
function create(instance, tx, callback) {
    var
        model = instance.__model,
        beforeCreate = model.__beforeCreate,
        params,
        value,
        sql;
    if (beforeCreate) {
        beforeCreate(instance);
    }
    // insert into TABLE () values (???)
    params = _.map(model.__insertAttributesArray, function (attr) {
        if (instance.hasOwnProperty(attr)) {
            return instance[attr];
        }
        var def = model.__attributes[attr];
        if (def.defaultValue !== undefined) {
            value = def.defaultValueIsFunction ? def.defaultValue() : def.defaultValue;
            instance[attr] = value;
            return value;
        }
        instance[attr] = null;
        return null;
    });
    sql = utils.format('insert into `%s` (%s) values(%s)', model.__table, model.__insertAttributesNames, utils.createPlaceholders(model.__insertAttributesArray.length));
    smartRunSQL(model.__pool, sql, params, tx, function (err, result) {
        if (err) {
            return callback(err);
        }
        if (model.__fetchInsertId) {
            instance[model.__primaryKey] = result.insertId;
        }
        callback(null, instance);
    });
}
105181
static void saveSchemas(MessageStore msgStore, JMFSchema[] schemas) throws MessageEncodeFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "saveSchemas");
    try {
      // Get the SchemaStore reference, creating a new one if necessary
      SchemaStoreItemStream schemaStore = getSchemaStore(msgStore);

      // Check if any new schemas need to be persisted to the SchemaStore
      for (int i = 0; i < schemas.length; i++) {
        if (!schemaStore.containsSchema(schemas[i].getLongID())) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Saving schema:" + schemas[i].getID());
          schemaStore.addSchema(schemas[i], msgStore.getTransactionFactory().createAutoCommitTransaction());
        }
      }
    } catch (MessageStoreException e) {
      FFDCFilter.processException(e, "saveSchemas", "83");
      throw new MessageEncodeFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "saveSchemas");
  }
1062533
private static String initMatchOwnerEntityNode(EntityKeyMetadata ownerEntityKeyMetadata) {
		StringBuilder queryBuilder = new StringBuilder();
		appendMatchOwnerEntityNode( queryBuilder, ownerEntityKeyMetadata );
		return queryBuilder.toString();
	}
487966
private void executeAddKeySpace(Tree statement)
    {

        if (!CliMain.isConnected())
            return;

        // first value is the keyspace name, after that it is all key=value
        String keyspaceName = CliUtils.unescapeSQLString(statement.getChild(0).getText());
        KsDef ksDef = new KsDef(keyspaceName, DEFAULT_PLACEMENT_STRATEGY, new LinkedList<CfDef>());

        try
        {
            String mySchemaVersion = thriftClient.system_add_keyspace(updateKsDefAttributes(statement, ksDef));
            sessionState.out.println(mySchemaVersion);

            keyspacesMap.put(keyspaceName, thriftClient.describe_keyspace(keyspaceName));
        }
        catch (InvalidRequestException e)
        {
            throw new RuntimeException(e);
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
    }
1317853
@Override
    public CompletableFuture<Void> initialize(Duration timeout) {
        Preconditions.checkState(!this.initialized.get(), "TableMetadataStore is already initialized.");

        // Invoke submitAssignment(), which will ensure that the Metadata Segment is mapped in memory and pinned.
        // If this is the first time we initialize the TableMetadataStore for this SegmentContainer, a new id will be
        // assigned to it.
        val attributes = TableAttributes.DEFAULT_VALUES
                .entrySet().stream()
                .map(e -> new AttributeUpdate(e.getKey(), AttributeUpdateType.None, e.getValue()))
                .collect(Collectors.toList());
        return submitAssignment(SegmentInfo.newSegment(this.metadataSegmentName, attributes), true, timeout)
                .thenAccept(segmentId -> {
                    this.initialized.set(true);
                    log.info("{}: Metadata Segment pinned. Name = '{}', Id = '{}'", this.metadataSegmentName, segmentId);
                });
    }
1224355
function createTable(table, transaction) {
    return (transaction || db.knex).schema.hasTable(table)
        .then(function (exists) {
            if (exists) {
                return;
            }

            return (transaction || db.knex).schema.createTable(table, function (t) {
                var columnKeys = _.keys(schema[table]);
                _.each(columnKeys, function (column) {
                    return addTableColumn(table, t, column);
                });
            });
        });
}
500729
private JMSContext createJMSContext(JMSContextInfo info, boolean tranIsActive) throws NamingException {
        inTransaction = tranIsActive;

        ConnectionFactory cf = (ConnectionFactory) new InitialContext().lookup(info.getConnectionFactoryString());

        if (inTransaction && cf instanceof XAConnectionFactory) {

            XAJMSContext xaContext = ((XAConnectionFactory) cf).createXAContext(info.getUserName(), info.getPassword());
            return xaContext.getContext();

        } else {

            return cf.createContext(info.getUserName(), info.getPassword(), info.getAcknowledgeMode());
        }
    }
129251
public void createBlob(String key, byte [] data, SettableBlobMeta meta) throws KeyAlreadyExistsException, IOException {
        AtomicOutputStream out = null;
        try {
            out = createBlob(key, meta);
            out.write(data);
            out.close();
            out = null;
        } finally {
            if (out != null) {
                out.cancel();
            }
        }
    }
233667
protected void writeEntityMetawidget(final Map<Object, Object> context, final int entityMetawidgetIndent,
            final Map<String, String> existingNamespaces)
   {
      StringWriter stringWriter = new StringWriter();
      this.entityMetawidget.write(stringWriter, entityMetawidgetIndent);
      context.put("metawidget", stringWriter.toString().trim());

      Map<String, String> namespaces = this.entityMetawidget.getNamespaces();
      namespaces.keySet().removeAll(existingNamespaces.keySet());
      context.put("metawidgetNamespaces", namespacesToString(namespaces));
   }
105554
@NonNull
  public static CreateAggregateStart createAggregate(
      @Nullable String keyspace, @NonNull String aggregateName) {
    return new DefaultCreateAggregate(
        keyspace == null ? null : CqlIdentifier.fromCql(keyspace),
        CqlIdentifier.fromCql(aggregateName));
  }
504722
void addSchema(JMFSchema schema, Transaction tran) throws MessageStoreException {
    addItem(new SchemaStoreItem(schema), tran);
  }
748453
def _initTable(self, tableName, schemaDef):
        cursor=_conn.execute("""
            SELECT * FROM sqlite_master WHERE name ='{0}' and type='table';
        """.format(tableName))
        if cursor.fetchone() is None:
            _conn.execute('''CREATE TABLE {0} ({1});'''.format(tableName, schemaDef))
            print("Table {0} created successfully".format(tableName))
        '''
        
        '''
        cursor.close()