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


Java CreateTableStatement.RawStatement方法代码示例

本文整理汇总了Java中org.apache.cassandra.cql3.statements.CreateTableStatement.RawStatement方法的典型用法代码示例。如果您正苦于以下问题:Java CreateTableStatement.RawStatement方法的具体用法?Java CreateTableStatement.RawStatement怎么用?Java CreateTableStatement.RawStatement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.cql3.statements.CreateTableStatement的用法示例。


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

示例1: cqlStatement

import org.apache.cassandra.cql3.statements.CreateTableStatement; //导入方法依赖的package包/类
public final ParsedStatement cqlStatement() throws RecognitionException {
	ParsedStatement stmt = null;

	CreateTableStatement.RawStatement st9 =null;


	try {
		// Parser.g:209:5: (st1= selectStatement |st2= insertStatement |st3= updateStatement |st4= batchStatement |st5= deleteStatement |st6= useStatement |st7= truncateStatement |st8= createKeyspaceStatement |st9= createTableStatement |st10= createIndexStatement |st11= dropKeyspaceStatement |st12= dropTableStatement |st13= dropIndexStatement |st14= alterTableStatement |st15= alterKeyspaceStatement |st16= grantPermissionsStatement |st17= revokePermissionsStatement |st18= listPermissionsStatement |st19= createUserStatement |st20= alterUserStatement |st21= dropUserStatement |st22= listUsersStatement |st23= createTriggerStatement |st24= dropTriggerStatement |st25= createTypeStatement |st26= alterTypeStatement |st27= dropTypeStatement |st28= createFunctionStatement |st29= dropFunctionStatement |st30= createAggregateStatement |st31= dropAggregateStatement |st32= createRoleStatement |st33= alterRoleStatement |st34= dropRoleStatement |st35= listRolesStatement |st36= grantRoleStatement |st37= revokeRoleStatement |st38= createMaterializedViewStatement |st39= dropMaterializedViewStatement |st40= alterMaterializedViewStatement )
		int alt1=40;
		alt1 = dfa1.predict(input);
		switch (alt1) {

			case 9 :
				// Parser.g:217:7: st9= createTableStatement
			{
				pushFollow(FOLLOW_createTableStatement_in_cqlStatement285);
				st9=createTableStatement();
				state._fsp--;

				stmt = st9;
			}
			break;

		}
	}
	catch (RecognitionException re) {
		reportError(re);
		recover(input,re);
	}
	finally {
		// do for sure before leaving
	}
	return stmt;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:35,代码来源:Cql_Parser.java

示例2: doSchema

import org.apache.cassandra.cql3.statements.CreateTableStatement; //导入方法依赖的package包/类
public void doSchema(String command) throws Exception {
    String path = command.substring(6).trim().replaceAll("\"", "");

    if (path.equalsIgnoreCase("off")) {
        System.out.println(DISABLING_SCHEMA);
        CassandraUtils.cqlOverride = null;
    } else if (Strings.isNullOrEmpty(path)) {
        if (!Strings.isNullOrEmpty(CassandraUtils.cqlOverride)) {
            System.out.printf(USER_DEFINED_SCHEMA, CassandraUtils.cqlOverride);
        } else {
            System.out.println(NO_USER_DEFINED_SCHEMA);
        }
    } else {
        File schemaFile = new File(path);
        if (!schemaFile.exists()) {
            System.err.printf(CANNOT_FIND_FILE, schemaFile.getAbsolutePath());
        } else {
            String cql = new String(Files.readAllBytes(schemaFile.toPath()));
            try {
                ParsedStatement statement = QueryProcessor.parseStatement(cql);
                if (statement instanceof CreateTableStatement.RawStatement) {
                    CassandraUtils.cqlOverride = cql;
                    System.out.printf(IMPORTED_SCHEMA, schemaFile.getAbsolutePath());
                } else {
                    System.err.printf(FAILED_TO_IMPORT_SCHEMA, schemaFile.getAbsoluteFile(), "Wrong type of statement, " + statement.getClass());
                }
            } catch (SyntaxException se) {
                System.err.printf(FAILED_TO_IMPORT_SCHEMA, schemaFile.getAbsoluteFile(), se.getMessage());
            }
        }
    }

}
 
开发者ID:tolbertam,项目名称:sstable-tools,代码行数:34,代码来源:Cqlsh.java

示例3: createTableStatement

import org.apache.cassandra.cql3.statements.CreateTableStatement; //导入方法依赖的package包/类
public final CreateTableStatement.RawStatement createTableStatement() throws RecognitionException {
	CreateTableStatement.RawStatement expr = null;


	CFName cf =null;

	boolean ifNotExists = false;
	try {
		// Parser.g:656:5: ( K_CREATE K_COLUMNFAMILY ( K_IF K_NOT K_EXISTS )? cf= columnFamilyName cfamDefinition[expr] )
		// Parser.g:656:7: K_CREATE K_COLUMNFAMILY ( K_IF K_NOT K_EXISTS )? cf= columnFamilyName cfamDefinition[expr]
		{
			match(input,K_CREATE,FOLLOW_K_CREATE_in_createTableStatement3883);
			match(input,K_COLUMNFAMILY,FOLLOW_K_COLUMNFAMILY_in_createTableStatement3885);
			// Parser.g:656:31: ( K_IF K_NOT K_EXISTS )?
			int alt70=2;
			int LA70_0 = input.LA(1);
			if ( (LA70_0==K_IF) ) {
				alt70=1;
			}
			switch (alt70) {
				case 1 :
					// Parser.g:656:32: K_IF K_NOT K_EXISTS
				{
					match(input,K_IF,FOLLOW_K_IF_in_createTableStatement3888);
					match(input,K_NOT,FOLLOW_K_NOT_in_createTableStatement3890);
					match(input,K_EXISTS,FOLLOW_K_EXISTS_in_createTableStatement3892);
					ifNotExists = true;
				}
				break;

			}

			pushFollow(FOLLOW_columnFamilyName_in_createTableStatement3907);
			cf=columnFamilyName();
			state._fsp--;

			expr = new CreateTableStatement.RawStatement(cf, ifNotExists);
			pushFollow(FOLLOW_cfamDefinition_in_createTableStatement3917);
			cfamDefinition(expr);
			state._fsp--;
		}

	}
	catch (RecognitionException re) {
		reportError(re);
		recover(input,re);
	}
	finally {
		// do for sure before leaving
	}
	return expr;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:53,代码来源:Cql_Parser.java

示例4: cfamDefinition

import org.apache.cassandra.cql3.statements.CreateTableStatement; //导入方法依赖的package包/类
public void cfamDefinition(CreateTableStatement.RawStatement expr) throws RecognitionException { gParser.cfamDefinition(expr); } 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:2,代码来源:CqlParser.java

示例5: pkDef

import org.apache.cassandra.cql3.statements.CreateTableStatement; //导入方法依赖的package包/类
public void pkDef(CreateTableStatement.RawStatement expr) throws RecognitionException { gParser.pkDef(expr); } 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:2,代码来源:CqlParser.java

示例6: cfamColumns

import org.apache.cassandra.cql3.statements.CreateTableStatement; //导入方法依赖的package包/类
public void cfamColumns(CreateTableStatement.RawStatement expr) throws RecognitionException { gParser.cfamColumns(expr); } 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:2,代码来源:CqlParser.java

示例7: createTableStatement

import org.apache.cassandra.cql3.statements.CreateTableStatement; //导入方法依赖的package包/类
public CreateTableStatement.RawStatement createTableStatement() throws RecognitionException { return gParser.createTableStatement(); } 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:2,代码来源:CqlParser.java


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