idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
35,600
private FilterList getExtPropertyFilters ( EntityMetadata m , FilterList filterList ) { Filter filter = getFilter ( m . getTableName ( ) ) ; if ( filter != null ) { if ( filterList == null ) { filterList = new FilterList ( ) ; } filterList . addFilter ( filter ) ; } return filterList ; }
Gets the ext property filters .
35,601
public HBaseRow createHbaseRow ( EntityMetadata m , Object entity , Object rowId , List < RelationHolder > relations ) throws IOException { MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; EntityType entityType = metaModel . entity ...
Creates the hbase row .
35,602
private List < HBaseCell > getRelationCell ( EntityMetadata m , Object rowId , List < RelationHolder > relations ) throws IOException { List < HBaseCell > relationCells = new ArrayList < HBaseCell > ( ) ; for ( RelationHolder relation : relations ) { HBaseCell hBaseCell = new HBaseCell ( m . getTableName ( ) , relation...
Gets the relation cell .
35,603
private void writeHbaseRowInATable ( String tableName , HBaseRow hbaseRow ) throws IOException { Table hTable = gethTable ( tableName ) ; ( ( HBaseWriter ) hbaseWriter ) . writeRow ( hTable , hbaseRow ) ; hTable . close ( ) ; }
Write hbase row in a table .
35,604
private void createCellsAndAddToRow ( Object entity , MetamodelImpl metaModel , Set < Attribute > attributes , HBaseRow hbaseRow , EntityMetadata m , int count , String prefix ) { AbstractAttribute idCol = ( AbstractAttribute ) m . getIdAttribute ( ) ; for ( Attribute attribute : attributes ) { AbstractAttribute absAtt...
Creates the cells and add to row .
35,605
public Table gethTable ( final String tableName ) throws IOException { return connection . getTable ( TableName . valueOf ( tableName ) ) ; }
Gets the h table .
35,606
private Object populateEntityFromHBaseData ( Object entity , HBaseDataWrapper hbaseData , EntityMetadata m , Object rowKey ) { try { Map < String , Object > relations = new HashMap < String , Object > ( ) ; if ( entity . getClass ( ) . isAssignableFrom ( EnhanceEntity . class ) ) { relations = ( ( EnhanceEntity ) entit...
Populate entity from hBase data .
35,607
private void writeValuesToEntity ( Object entity , HBaseDataWrapper hbaseData , EntityMetadata m , MetamodelImpl metaModel , Set < Attribute > attributes , List < String > relationNames , Map < String , Object > relations , int count , String prefix ) { for ( Attribute attribute : attributes ) { Class javaType = ( ( Ab...
Write values to entity .
35,608
private void processEmbeddable ( Object entity , HBaseDataWrapper hbaseData , EntityMetadata m , MetamodelImpl metaModel , int count , String prefix , Attribute attribute , Class javaType ) { Set < Attribute > attribEmbeddables = metaModel . embeddable ( javaType ) . getAttributes ( ) ; Object embeddedField = KunderaCo...
Process embeddable .
35,609
public void setFilter ( Filter filter ) { if ( this . filter == null ) { this . filter = new FilterList ( ) ; } if ( filter != null ) { this . filter . addFilter ( filter ) ; } }
Sets the filter .
35,610
private List onRead ( EntityMetadata m , List < Map < String , Object > > columnsToOutput , Table hTable , List < HBaseDataWrapper > results ) throws IOException { Class clazz = m . getEntityClazz ( ) ; List outputResults = new ArrayList ( ) ; try { if ( results != null ) { return columnsToOutput != null && ! columnsTo...
On read .
35,611
private List returnEntityObjectList ( EntityMetadata m , List < HBaseDataWrapper > results , List outputResults ) { Map < Object , Object > entityListMap = new HashMap < Object , Object > ( ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUn...
Return entity object list .
35,612
private List returnSpecificFieldList ( EntityMetadata m , List < Map < String , Object > > columnsToOutput , List < HBaseDataWrapper > results , List outputResults ) { for ( HBaseDataWrapper data : results ) { List result = new ArrayList ( ) ; Map < String , byte [ ] > columns = data . getColumns ( ) ; for ( Map < Stri...
Return specific field list .
35,613
private boolean isIdCol ( EntityMetadata m , String colName ) { return ( ( AbstractAttribute ) m . getIdAttribute ( ) ) . getJPAColumnName ( ) . equals ( colName ) ; }
Checks if is id col .
35,614
private Object populateEmbeddableObject ( HBaseDataWrapper data , Object obj , EntityMetadata m , Class clazz , String prefix ) { MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; Set < Attribute > attributes = metaModel . embeddable...
Populate embeddable object .
35,615
private Object getObjectFromByteArray ( EntityType entityType , byte [ ] value , String jpaColumnName , EntityMetadata m ) { if ( jpaColumnName != null ) { String fieldName = m . getFieldName ( jpaColumnName ) ; if ( fieldName != null ) { Attribute attribute = fieldName != null ? entityType . getAttribute ( fieldName )...
Gets the object from byte array .
35,616
public HBaseDataHandler getHandle ( ) { HBaseDataHandler handler = new HBaseDataHandler ( this . kunderaMetadata , this . connection ) ; handler . filter = this . filter ; handler . filters = this . filters ; return handler ; }
Gets the handle .
35,617
private Transaction onBegin ( ) { Transaction tx ; if ( ( ( StatelessSessionImpl ) s ) . getTransactionCoordinator ( ) . isTransactionActive ( ) ) { tx = ( ( StatelessSessionImpl ) s ) . getTransaction ( ) ; } else { tx = s . beginTransaction ( ) ; } return tx ; }
On begin .
35,618
public void persistJoinTable ( JoinTableData joinTableData ) { String schemaName = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , joinTableData . getEntityClass ( ) ) . getSchema ( ) ; String joinTableName = joinTableData . getJoinTableName ( ) ; String joinColumnName = joinTableData . getJoinColumnName...
Inserts records into JoinTable .
35,619
private void insertRecordInJoinTable ( String schemaName , String joinTableName , String joinColumnName , String inverseJoinColumnName , Object parentId , Set < Object > childrenIds ) { s = getStatelessSession ( ) ; Transaction tx = onBegin ( ) ; for ( Object childId : childrenIds ) { StringBuffer query = new StringBuf...
Insert record in join table .
35,620
public int onNativeUpdate ( String query , Map < Parameter , Object > parameterMap ) { s = getStatelessSession ( ) ; Query q = s . createSQLQuery ( query ) ; setParameters ( parameterMap , q ) ; int i = q . executeUpdate ( ) ; return i ; }
On native update .
35,621
private Object [ ] getDataType ( EntityMetadata entityMetadata , Object ... arg1 ) throws PropertyAccessException { Field idField = ( Field ) entityMetadata . getIdAttribute ( ) . getJavaMember ( ) ; PropertyAccessor < ? > accessor = PropertyAccessorFactory . getPropertyAccessor ( idField ) ; Object [ ] pKeys = new Obj...
Gets the data type .
35,622
private String getFromClause ( String schemaName , String tableName ) { String clause = tableName ; if ( schemaName != null && ! schemaName . isEmpty ( ) ) { clause = schemaName + "." + tableName ; } return clause ; }
Gets the from clause .
35,623
private void updateForeignKeys ( EntityMetadata metadata , Object id , List < RelationHolder > relationHolders ) { for ( RelationHolder rh : relationHolders ) { String linkName = rh . getRelationName ( ) ; Object linkValue = rh . getRelationValue ( ) ; if ( linkName != null && linkValue != null ) { String clause = getF...
Updates foreign keys into master table .
35,624
private boolean removeKunderaProxies ( EntityMetadata metadata , Object entity , List < RelationHolder > relationHolders ) { boolean proxyRemoved = false ; for ( Relation relation : metadata . getRelations ( ) ) { if ( relation != null && relation . isUnary ( ) ) { Object relationObject = PropertyAccessorHelper . getOb...
Removes the kundera proxies .
35,625
private void setParameters ( Map < Parameter , Object > parameterMap , Query q ) { if ( parameterMap != null && ! parameterMap . isEmpty ( ) ) { for ( Parameter parameter : parameterMap . keySet ( ) ) { Object paramObject = parameterMap . get ( parameter ) ; if ( parameter . getName ( ) != null ) { if ( paramObject ins...
Sets the parameters .
35,626
public void dropSchema ( ) { if ( operation != null && operation . equalsIgnoreCase ( "create-drop" ) ) { try { dropKeyspaceOrCFs ( ) ; } catch ( Exception ex ) { log . error ( "Error during dropping schema in cassandra, Caused by: ." , ex ) ; throw new SchemaGenerationException ( ex , "Cassandra" ) ; } } cassandra_cli...
drop schema method drop the table from keyspace .
35,627
private void dropKeyspaceOrCFs ( ) throws InvalidRequestException , SchemaDisagreementException , TException , Exception { if ( createdKeyspaces . contains ( databaseName ) ) { cassandra_client . system_drop_keyspace ( databaseName ) ; } else { cassandra_client . set_keyspace ( databaseName ) ; for ( TableInfo tableInf...
Drop keyspace or c fs .
35,628
private void dropColumnFamily ( TableInfo tableInfo ) throws Exception { if ( isCql3Enabled ( tableInfo ) ) { dropTableUsingCql ( tableInfo ) ; } else { cassandra_client . system_drop_column_family ( tableInfo . getTableName ( ) ) ; } }
Drops column family specified in table info .
35,629
private KsDef onCreateKeyspace ( ) throws Exception { try { createdKeyspaces . add ( databaseName ) ; createKeyspace ( ) ; } catch ( InvalidRequestException irex ) { createdKeyspaces . remove ( databaseName ) ; } cassandra_client . set_keyspace ( databaseName ) ; return cassandra_client . describe_keyspace ( databaseNa...
On create keyspace .
35,630
private void createKeyspace ( ) throws Exception { if ( cql_version != null && cql_version . equals ( CassandraConstants . CQL_VERSION_3_0 ) ) { onCql3CreateKeyspace ( ) ; } else { Map < String , String > strategy_options = new HashMap < String , String > ( ) ; List < CfDef > cfDefs = new ArrayList < CfDef > ( ) ; KsDe...
Creates keyspace .
35,631
private void onCql3CreateKeyspace ( ) throws InvalidRequestException , UnavailableException , TimedOutException , SchemaDisagreementException , TException , UnsupportedEncodingException { String createKeyspace = CQLTranslator . CREATE_KEYSPACE ; String placement_strategy = csmd . getPlacement_strategy ( databaseName ) ...
On cql3 create keyspace .
35,632
private void createColumnFamilies ( List < TableInfo > tableInfos , KsDef ksDef ) throws Exception { for ( TableInfo tableInfo : tableInfos ) { if ( isCql3Enabled ( tableInfo ) ) { createOrUpdateUsingCQL3 ( tableInfo , ksDef ) ; createIndexUsingCql ( tableInfo ) ; } else { createOrUpdateColumnFamily ( tableInfo , ksDef...
Creates the column families .
35,633
private void createOrUpdateColumnFamily ( TableInfo tableInfo , KsDef ksDef ) throws Exception { MetaDataHandler handler = new MetaDataHandler ( ) ; if ( containsCompositeKey ( tableInfo ) ) { validateCompoundKey ( tableInfo ) ; createOrUpdateUsingCQL3 ( tableInfo , ksDef ) ; createIndexUsingCql ( tableInfo ) ; } else ...
Creates the or update column family .
35,634
private boolean containsCompositeKey ( TableInfo tableInfo ) { return tableInfo . getTableIdType ( ) != null && tableInfo . getTableIdType ( ) . isAnnotationPresent ( Embeddable . class ) ; }
Contains composite key .
35,635
private void updateExistingColumnFamily ( TableInfo tableInfo , KsDef ksDef , InvalidRequestException irex ) throws Exception { StringBuilder builder = new StringBuilder ( "^Cannot add already existing (?:column family|table) .*$" ) ; if ( irex . getWhy ( ) != null && irex . getWhy ( ) . matches ( builder . toString ( ...
Update existing column family .
35,636
private void handleCreate ( TableInfo tableInfo , KsDef ksDef ) throws Exception { if ( containsCompositeKey ( tableInfo ) ) { validateCompoundKey ( tableInfo ) ; dropTableUsingCql ( tableInfo ) ; } else { onDrop ( tableInfo ) ; } createOrUpdateColumnFamily ( tableInfo , ksDef ) ; }
Handle create .
35,637
protected void update ( List < TableInfo > tableInfos ) { try { createOrUpdateKeyspace ( tableInfos ) ; } catch ( Exception ex ) { log . error ( "Error occurred while creating {}, Caused by: ." , databaseName , ex ) ; throw new SchemaGenerationException ( ex ) ; } }
update method update schema and table for the list of tableInfos .
35,638
private void getCompositeIdEmbeddables ( EmbeddableType embeddable , List compositeEmbeddables , MetamodelImpl metaModel ) { compositeEmbeddables . add ( embeddable . getJavaType ( ) . getSimpleName ( ) ) ; for ( Object column : embeddable . getAttributes ( ) ) { Attribute columnAttribute = ( Attribute ) column ; Field...
Gets the composite id embeddables .
35,639
private void onEmbeddedColumns ( CQLTranslator translator , TableInfo tableInfo , StringBuilder queryBuilder , List compositeEmbeddables ) { List < EmbeddedColumnInfo > embeddedColumns = tableInfo . getEmbeddedColumnMetadatas ( ) ; for ( EmbeddedColumnInfo embColInfo : embeddedColumns ) { if ( ! compositeEmbeddables . ...
On embedded columns .
35,640
private void postProcessEmbedded ( Map < String , String > embNametoUDTQuery , Map < String , List < String > > embNametoDependentList ) { for ( Map . Entry < String , List < String > > entry : embNametoDependentList . entrySet ( ) ) { checkRelationAndExecuteQuery ( entry . getKey ( ) , embNametoDependentList , embName...
Post process embedded .
35,641
private void checkRelationAndExecuteQuery ( String embeddableKey , Map < String , List < String > > embeddableToDependentEmbeddables , Map < String , String > queries ) { List < String > dependentEmbeddables = embeddableToDependentEmbeddables . get ( embeddableKey ) ; if ( ! dependentEmbeddables . isEmpty ( ) ) { for (...
Check relation and execute query .
35,642
private void appendPrimaryKey ( CQLTranslator translator , EmbeddableType compoEmbeddableType , Field [ ] fields , StringBuilder queryBuilder ) { for ( Field f : fields ) { if ( ! ReflectUtils . isTransientOrStatic ( f ) ) { if ( f . getType ( ) . isAnnotationPresent ( Embeddable . class ) ) { MetamodelImpl metaModel =...
Append primary key .
35,643
private void appendClusteringOrder ( CQLTranslator translator , List < ColumnInfo > compositeColumns , StringBuilder clusterKeyOrderingBuilder , StringBuilder primaryKeyBuilder ) { String [ ] primaryKeys = primaryKeyBuilder . toString ( ) . split ( "\\s*,\\s*" ) ; for ( String primaryKey : primaryKeys ) { primaryKey = ...
Append clustering order .
35,644
private StringBuilder replaceColumnsAndStripLastChar ( String columnFamilyQuery , StringBuilder queryBuilder ) { if ( queryBuilder . length ( ) > 0 ) { queryBuilder . deleteCharAt ( queryBuilder . length ( ) - 1 ) ; columnFamilyQuery = StringUtils . replace ( columnFamilyQuery , CQLTranslator . COLUMNS , queryBuilder ....
Strip last char .
35,645
private void createIndexUsingThrift ( TableInfo tableInfo , CfDef cfDef ) throws Exception { for ( IndexInfo indexInfo : tableInfo . getColumnsToBeIndexed ( ) ) { for ( ColumnDef columnDef : cfDef . getColumn_metadata ( ) ) { if ( new String ( columnDef . getName ( ) , Constants . ENCODING ) . equals ( indexInfo . getC...
Creates the index using thrift .
35,646
private void createIndexUsingCql ( TableInfo tableInfo ) throws Exception { List < String > embeddedIndexes = new ArrayList < String > ( ) ; for ( EmbeddedColumnInfo embeddedColumnInfo : tableInfo . getEmbeddedColumnMetadatas ( ) ) { for ( ColumnInfo columnInfo : embeddedColumnInfo . getColumns ( ) ) { if ( columnInfo ...
Create secondary indexes on columns .
35,647
private void dropTableUsingCql ( TableInfo tableInfo ) throws Exception { CQLTranslator translator = new CQLTranslator ( ) ; StringBuilder dropQuery = new StringBuilder ( "drop table " ) ; translator . ensureCase ( dropQuery , tableInfo . getTableName ( ) , false ) ; KunderaCoreUtils . printQuery ( dropQuery . toString...
Drops table using cql3 .
35,648
private void addColumnToTable ( TableInfo tableInfo , ColumnInfo column ) throws Exception { CQLTranslator translator = new CQLTranslator ( ) ; StringBuilder addColumnQuery = new StringBuilder ( "ALTER TABLE " ) ; translator . ensureCase ( addColumnQuery , tableInfo . getTableName ( ) , false ) ; addColumnQuery . appen...
Adds column to table if not exists previously i . e . alter table .
35,649
private void alterColumnType ( TableInfo tableInfo , CQLTranslator translator , ColumnInfo column ) throws Exception { StringBuilder alterColumnTypeQuery = new StringBuilder ( "ALTER TABLE " ) ; translator . ensureCase ( alterColumnTypeQuery , tableInfo . getTableName ( ) , false ) ; alterColumnTypeQuery . append ( " A...
showSchema Alters column type of an existing column .
35,650
private void onCompositeColumns ( CQLTranslator translator , List < ColumnInfo > compositeColumns , StringBuilder queryBuilder , List < ColumnInfo > columns , boolean isCounterColumnFamily ) { MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( puMetadata . getPersi...
On composite columns .
35,651
private void validateAndAppendColumnName ( CQLTranslator translator , StringBuilder queryBuilder , String b , Class < ? > clazz ) { String dataType = CassandraValidationClassMapper . getValidationClass ( clazz , true ) ; translator . appendColumnName ( queryBuilder , b , translator . getCQLType ( dataType ) ) ; queryBu...
Validate and append column name .
35,652
private void onCollectionColumns ( CQLTranslator translator , List < CollectionColumnInfo > collectionColumnInfos , StringBuilder queryBuilder ) { for ( CollectionColumnInfo cci : collectionColumnInfos ) { String dataType = CassandraValidationClassMapper . getValidationClass ( cci . getType ( ) , true ) ; String collec...
Generates schema for Collection columns .
35,653
private void createInvertedIndexTable ( TableInfo tableInfo , KsDef ksDef ) throws Exception { CfDef cfDef = getInvertedIndexCF ( tableInfo ) ; if ( cfDef != null ) { try { cassandra_client . system_add_column_family ( cfDef ) ; } catch ( InvalidRequestException irex ) { updateExistingColumnFamily ( tableInfo , ksDef ,...
Creates the inverted index table .
35,654
private CfDef getInvertedIndexCF ( TableInfo tableInfo ) throws InvalidRequestException , SchemaDisagreementException , TException { boolean indexTableRequired = CassandraPropertyReader . csmd . isInvertedIndexingEnabled ( databaseName ) && ! tableInfo . getEmbeddedColumnMetadatas ( ) . isEmpty ( ) ; if ( indexTableReq...
Gets the inverted index cf .
35,655
private void dropInvertedIndexTable ( TableInfo tableInfo ) { boolean indexTableRequired = CassandraPropertyReader . csmd . isInvertedIndexingEnabled ( databaseName ) && ! tableInfo . getEmbeddedColumnMetadatas ( ) . isEmpty ( ) ; if ( indexTableRequired ) { try { cassandra_client . system_drop_column_family ( tableInf...
Drop inverted index table .
35,656
private void onValidateTable ( KsDef ksDef , TableInfo tableInfo ) throws Exception { boolean tablefound = false ; for ( CfDef cfDef : ksDef . getCf_defs ( ) ) { if ( cfDef . getName ( ) . equals ( tableInfo . getTableName ( ) ) ) { if ( cfDef . getColumn_type ( ) . equals ( ColumnFamilyType . Standard . name ( ) ) ) {...
On validate table .
35,657
private void onValidateColumn ( TableInfo tableInfo , CfDef cfDef , ColumnInfo columnInfo ) throws Exception { boolean columnfound = false ; boolean isCounterColumnType = isCounterColumnType ( tableInfo , null ) ; for ( ColumnDef columnDef : cfDef . getColumn_metadata ( ) ) { if ( isMetadataSame ( columnDef , columnInf...
On validate column .
35,658
private boolean isMetadataSame ( ColumnDef columnDef , ColumnInfo columnInfo , boolean isCql3Enabled , boolean isCounterColumnType ) throws Exception { return isIndexPresent ( columnInfo , columnDef , isCql3Enabled , isCounterColumnType ) ; }
is metadata same method returns true if ColumnDef and columnInfo have same metadata .
35,659
private void updateTable ( KsDef ksDef , TableInfo tableInfo ) throws Exception { for ( CfDef cfDef : ksDef . getCf_defs ( ) ) { if ( cfDef . getName ( ) . equals ( tableInfo . getTableName ( ) ) && cfDef . getColumn_type ( ) . equals ( ColumnFamilyType . getInstanceOf ( tableInfo . getType ( ) ) . name ( ) ) ) { boole...
Update table .
35,660
private boolean isCfDefUpdated ( ColumnInfo columnInfo , CfDef cfDef , boolean isCql3Enabled , boolean isCounterColumnType , TableInfo tableInfo ) throws Exception { boolean columnPresent = false ; boolean isUpdated = false ; for ( ColumnDef columnDef : cfDef . getColumn_metadata ( ) ) { if ( isColumnPresent ( columnIn...
Checks if is cf def updated .
35,661
private ColumnDef getColumnMetadata ( ColumnInfo columnInfo , TableInfo tableInfo ) { ColumnDef columnDef = new ColumnDef ( ) ; columnDef . setName ( columnInfo . getColumnName ( ) . getBytes ( ) ) ; columnDef . setValidation_class ( CassandraValidationClassMapper . getValidationClass ( columnInfo . getType ( ) , isCql...
getColumnMetadata use for getting column metadata for specific columnInfo .
35,662
private void setProperties ( KsDef ksDef , Map < String , String > strategy_options ) { Schema schema = CassandraPropertyReader . csmd . getSchema ( databaseName ) ; if ( schema != null && schema . getName ( ) != null && schema . getName ( ) . equalsIgnoreCase ( databaseName ) && schema . getSchemaProperties ( ) != nul...
Sets the properties .
35,663
private void setKeyspaceProperties ( KsDef ksDef , Properties schemaProperties , Map < String , String > strategyOptions , List < DataCenter > dcs ) { String placementStrategy = schemaProperties . getProperty ( CassandraConstants . PLACEMENT_STRATEGY , SimpleStrategy . class . getSimpleName ( ) ) ; if ( placementStrate...
Sets the keyspace properties .
35,664
private Properties getColumnFamilyProperties ( TableInfo tableInfo ) { if ( tables != null ) { for ( Table table : tables ) { if ( table != null && table . getName ( ) != null && table . getName ( ) . equalsIgnoreCase ( tableInfo . getTableName ( ) ) ) { return table . getProperties ( ) ; } } } return null ; }
Gets the column family properties .
35,665
public boolean validateEntity ( Class clazz ) { EntityValidatorAgainstCounterColumn entityValidatorAgainstSchema = new EntityValidatorAgainstCounterColumn ( ) ; return entityValidatorAgainstSchema . validateEntity ( clazz ) ; }
validates entity for CounterColumnType .
35,666
private void setColumnFamilyProperties ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { if ( ( cfDef != null && cfProperties != null ) || ( builder != null && cfProperties != null ) ) { if ( builder != null ) { builder . append ( CQLTranslator . WITH_CLAUSE ) ; } onSetKeyValidation ( cfDef , cfProper...
Sets the column family properties .
35,667
private void onSetReadRepairChance ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String dclocalReadRepairChance = cfProperties . getProperty ( CassandraConstants . DCLOCAL_READ_REPAIR_CHANCE ) ; if ( dclocalReadRepairChance != null ) { try { if ( builder != null ) { appendPropertyToBuilder ( build...
On set read repair chance .
35,668
private void onSetRepairChance ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String readRepairChance = cfProperties . getProperty ( CassandraConstants . READ_REPAIR_CHANCE ) ; if ( readRepairChance != null ) { try { if ( builder != null ) { appendPropertyToBuilder ( builder , readRepairChance , Ca...
On set repair chance .
35,669
private void onSetBloomFilter ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String bloomFilterFpChance = cfProperties . getProperty ( CassandraConstants . BLOOM_FILTER_FP_CHANCE ) ; if ( bloomFilterFpChance != null ) { try { if ( builder != null ) { appendPropertyToBuilder ( builder , bloomFilterF...
On set bloom filter .
35,670
private void onSetCaching ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String caching = cfProperties . getProperty ( CassandraConstants . CACHING ) ; if ( caching != null ) { if ( builder != null ) { appendPropertyToBuilder ( builder , caching , CassandraConstants . CACHING ) ; } else { cfDef . s...
On set caching .
35,671
private void onSetGcGrace ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String gcGraceSeconds = cfProperties . getProperty ( CassandraConstants . GC_GRACE_SECONDS ) ; if ( gcGraceSeconds != null ) { try { if ( builder != null ) { appendPropertyToBuilder ( builder , gcGraceSeconds , CassandraConsta...
On set gc grace .
35,672
private void onSetTableId ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String id = cfProperties . getProperty ( CassandraConstants . ID ) ; if ( id != null ) { try { if ( builder != null ) { } else { cfDef . setId ( Integer . parseInt ( id ) ) ; } } catch ( NumberFormatException nfe ) { log . err...
On set table id .
35,673
private void onSetComment ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String comment = cfProperties . getProperty ( CassandraConstants . COMMENT ) ; if ( comment != null ) { if ( builder != null ) { String comment_Str = CQLTranslator . getKeyword ( CassandraConstants . COMMENT ) ; builder . appe...
On set comment .
35,674
private void onSetReplicateOnWrite ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String replicateOnWrite = cfProperties . getProperty ( CassandraConstants . REPLICATE_ON_WRITE ) ; if ( builder != null ) { String replicateOn_Write = CQLTranslator . getKeyword ( CassandraConstants . REPLICATE_ON_WRI...
On set replicate on write .
35,675
private void onSetCompactionThreshold ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String maxCompactionThreshold = cfProperties . getProperty ( CassandraConstants . MAX_COMPACTION_THRESHOLD ) ; if ( maxCompactionThreshold != null ) { try { if ( builder != null ) { } else { cfDef . setMax_compacti...
On set compaction threshold .
35,676
private void onSetSubComparator ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String subComparatorType = cfProperties . getProperty ( CassandraConstants . SUBCOMPARATOR_TYPE ) ; if ( subComparatorType != null && ColumnFamilyType . valueOf ( cfDef . getColumn_type ( ) ) == ColumnFamilyType . Super ...
On set sub comparator .
35,677
private void onSetComparatorType ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String comparatorType = cfProperties . getProperty ( CassandraConstants . COMPARATOR_TYPE ) ; if ( comparatorType != null ) { if ( builder != null ) { } else { cfDef . setComparator_type ( comparatorType ) ; } } }
On set comparator type .
35,678
private void onSetCompactionStrategy ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String compactionStrategy = cfProperties . getProperty ( CassandraConstants . COMPACTION_STRATEGY ) ; if ( compactionStrategy != null ) { if ( builder != null ) { String strategy_class = CQLTranslator . getKeyword (...
On set compaction strategy .
35,679
private void onSetKeyValidation ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { String keyValidationClass = cfProperties . getProperty ( CassandraConstants . KEY_VALIDATION_CLASS ) ; if ( keyValidationClass != null ) { if ( builder != null ) { } else { cfDef . setKey_validation_class ( keyValidation...
On set key validation .
35,680
private boolean isCql3Enabled ( TableInfo tableInfo ) { Properties cfProperties = getColumnFamilyProperties ( tableInfo ) ; String defaultValidationClass = cfProperties != null ? cfProperties . getProperty ( CassandraConstants . DEFAULT_VALIDATION_CLASS ) : null ; boolean isCounterColumnType = isCounterColumnType ( tab...
Checks if is cql3 enabled .
35,681
private void appendPropertyToBuilder ( StringBuilder builder , String replicateOnWrite , String keyword ) { String replicateOn_Write = CQLTranslator . getKeyword ( keyword ) ; builder . append ( replicateOn_Write ) ; builder . append ( CQLTranslator . EQ_CLAUSE ) ; builder . append ( replicateOnWrite ) ; builder . appe...
Append property to builder .
35,682
private void validateCompoundKey ( TableInfo tableInfo ) { if ( tableInfo . getType ( ) != null && tableInfo . getType ( ) . equals ( Type . SUPER_COLUMN_FAMILY . name ( ) ) ) { throw new SchemaGenerationException ( "Composite/Compound columns are not yet supported over Super column family by Cassandra" , "cassandra" ,...
Validate compound key .
35,683
private void onLog ( TableInfo tableInfo , CqlMetadata metadata , Map < ByteBuffer , String > value_types , CqlMetadata originalMetadata ) throws CharacterCodingException { System . out . format ( "Persisted Schema for " + tableInfo . getTableName ( ) ) ; System . out . format ( "\n" ) ; System . out . format ( "Column...
Print log in case schema doesn t match! .
35,684
private boolean isCounterColumnType ( TableInfo tableInfo , String defaultValidationClass ) { return ( csmd != null && csmd . isCounterColumn ( databaseName , tableInfo . getTableName ( ) ) ) || ( defaultValidationClass != null && ( defaultValidationClass . equalsIgnoreCase ( CounterColumnType . class . getSimpleName (...
Checks if is counter column type .
35,685
private Object fetch ( Class clazz , Object key , Object connection , byte [ ] [ ] fields ) throws InstantiationException , IllegalAccessException { Object result = null ; EntityMetadata entityMetadata = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , clazz ) ; MetamodelImpl metaModel = ( MetamodelImpl )...
Retrieves entity instance of given class row key and specific fields .
35,686
private void deleteRelation ( Object connection , EntityMetadata entityMetadata , String rowKey ) { List < String > relations = entityMetadata . getRelationNames ( ) ; if ( relations != null ) { for ( String relation : relations ) { if ( resource != null && resource . isActive ( ) ) { ( ( Transaction ) connection ) . h...
On delete relation .
35,687
private List fetchColumn ( String columnName , Object connection , List results , Set < String > resultKeys ) { for ( String hashKey : resultKeys ) { List columnValues = null ; if ( resource != null && resource . isActive ( ) ) { Response response = ( ( Transaction ) connection ) . hmget ( hashKey , columnName ) ; ( ( ...
Fetch column .
35,688
private Object [ ] findIdsByColumn ( String tableName , String columnName , Object columnValue ) { Object connection = null ; try { connection = getConnection ( ) ; String valueAsStr = PropertyAccessorHelper . getString ( columnValue ) ; Set < String > results = null ; if ( resource != null && resource . isActive ( ) )...
Find ids by column .
35,689
private String getHashKey ( final String tableName , final String rowKey ) { StringBuilder builder = new StringBuilder ( tableName ) ; builder . append ( ":" ) ; builder . append ( rowKey ) ; return builder . toString ( ) ; }
Returns hash key .
35,690
byte [ ] getEncodedBytes ( final String name ) { try { if ( name != null ) { return name . getBytes ( Constants . CHARSET_UTF8 ) ; } } catch ( UnsupportedEncodingException e ) { logger . error ( "Error during persist, Caused by:" , e ) ; throw new PersistenceException ( e ) ; } return null ; }
Returns encoded bytes .
35,691
private void addIndex ( final Object connection , final AttributeWrapper wrapper , final String rowKey , final EntityMetadata metadata ) { Indexer indexer = indexManager . getIndexer ( ) ; if ( indexer != null && indexer . getClass ( ) . getSimpleName ( ) . equals ( "RedisIndexer" ) ) { wrapper . addIndex ( getHashKey ...
Add inverted index in sorted set .
35,692
private void unIndex ( final Object connection , final AttributeWrapper wrapper , final String member ) { Set < String > keys = wrapper . getIndexes ( ) . keySet ( ) ; for ( String key : keys ) { if ( resource != null && resource . isActive ( ) ) { ( ( Transaction ) connection ) . zrem ( key , member ) ; } else { ( ( P...
Deletes inverted indexes from redis .
35,693
private void onCleanup ( Object connection ) { if ( this . connection != null ) { if ( settings != null ) { ( ( Jedis ) connection ) . configResetStat ( ) ; } factory . releaseConnection ( ( Jedis ) this . connection ) ; } this . connection = null ; }
On release connection .
35,694
private void addToWrapper ( EntityMetadata entityMetadata , AttributeWrapper wrapper , Object resultedObject , Attribute attrib ) { addToWrapper ( entityMetadata , wrapper , resultedObject , attrib , null ) ; }
Adds field to wrapper .
35,695
private Object reInitialize ( Object connection , Set < String > rowKeys ) { connection = getConnection ( ) ; return connection ; }
Re initialize .
35,696
private < E > List < E > findAllColumns ( Class < E > entityClass , byte [ ] [ ] columns , Object ... keys ) { Object connection = getConnection ( ) ; List results = new ArrayList ( ) ; try { for ( Object key : keys ) { Object result = fetch ( entityClass , key , connection , columns ) ; if ( result != null ) { results...
Find all columns .
35,697
private Object getConnection ( ) { if ( isBoundTransaction ( ) && this . connection != null ) { return this . connection ; } if ( resource != null && resource . isActive ( ) ) { if ( ( ( RedisTransaction ) resource ) . isResourceBound ( ) ) { return ( ( RedisTransaction ) resource ) . getResource ( ) ; } else { Jedis c...
Returns jedis connection .
35,698
private Jedis getAndSetConnection ( ) { Jedis conn = factory . getConnection ( ) ; this . connection = conn ; if ( settings != null ) { for ( String key : settings . keySet ( ) ) { conn . configSet ( key , settings . get ( key ) . toString ( ) ) ; } } return conn ; }
Gets the and set connection .
35,699
private void initializeIndexer ( ) { if ( this . indexManager . getIndexer ( ) != null && this . indexManager . getIndexer ( ) . getClass ( ) . getSimpleName ( ) . equals ( "RedisIndexer" ) ) { ( ( RedisIndexer ) this . indexManager . getIndexer ( ) ) . assignConnection ( getConnection ( ) ) ; } }
Initialize indexer .