Skip to content

Commit

Permalink
removed code related to stream entity
Browse files Browse the repository at this point in the history
  • Loading branch information
NehaSelvan1512 committed Oct 17, 2023
1 parent 5c3723e commit 15ee90f
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 111 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/polypheny/db/catalog/Catalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -1933,8 +1933,8 @@ public enum EntityType {
ENTITY( 1 ),
SOURCE( 2 ),
VIEW( 3 ),
MATERIALIZED_VIEW( 4 ),
STREAM(5);
MATERIALIZED_VIEW( 4 );
//STREAM(5);

private final int id;

Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/org/polypheny/db/ddl/DdlManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,6 @@ public static DdlManager getInstance() {

public abstract void createCollection( long schemaId, String name, boolean ifNotExists, List<DataStore> stores, PlacementType placementType, Statement statement ) throws EntityAlreadyExistsException;

public abstract void createStreamCollection(long schemaId, String name, boolean ifNotExists, List<DataStore> stores, PlacementType placementType, Statement statement ) throws EntityAlreadyExistsException;

public abstract void addCollectionPlacement( long namespaceId, String name, List<DataStore> stores, Statement statement );

/**
Expand Down

This file was deleted.

50 changes: 0 additions & 50 deletions dbms/src/main/java/org/polypheny/db/ddl/DdlManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -2293,56 +2293,6 @@ public void createCollection( long schemaId, String name, boolean ifNotExists, L
}


@Override
public void createStreamCollection( long schemaId, String name, boolean ifNotExists, List<DataStore> stores, PlacementType placementType, Statement statement ) throws EntityAlreadyExistsException {
name = adjustNameIfNeeded( name, schemaId );

if ( assertEntityExists( schemaId, name, ifNotExists ) ) {
return;
}

if ( stores == null ) {
// Ask router on which store(s) the table should be placed
stores = RoutingManager.getInstance().getCreatePlacementStrategy().getDataStoresForNewTable();
}

long collectionId;
long partitionId;
try {
collectionId = catalog.addCollectionLogistics( schemaId, name, stores, false );
partitionId = catalog.getPartitionGroups( collectionId ).get( 0 ).id;
} catch ( GenericCatalogException e ) {
throw new RuntimeException( e );
}

catalog.addCollection(
collectionId,
name,
schemaId,
statement.getPrepareContext().getCurrentUserId(),
EntityType.STREAM,
true );

// Initially create DataPlacement containers on every store the table should be placed.
CatalogCollection catalogCollection = catalog.getCollection( collectionId );

// Trigger rebuild of schema; triggers schema creation on adapters
PolySchemaBuilder.getInstance().getCurrent();

for ( DataStore store : stores ) {
catalog.addCollectionPlacement(
store.getAdapterId(),
catalogCollection.id,
PlacementType.AUTOMATIC );

afterDocumentLogistics( store, collectionId );

store.createCollection( statement.getPrepareContext(), catalogCollection, store.getAdapterId() );
}

}


private boolean assertEntityExists( long namespaceId, String name, boolean ifNotExists ) throws EntityAlreadyExistsException {
// Check if there is already an entity with this name
if ( catalog.checkIfExistsEntity( namespaceId, name ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,6 @@ private void buildDocumentLogical( AbstractPolyphenyDbSchema polyphenyDbSchema,
catalogEntity.getNamespaceName(),
catalogEntity.name,
AlgDataTypeImpl.proto( fieldInfo.build() ) );

} else if ( catalogEntity.entityType == EntityType.STREAM ) {
entity = new LogicalStreamCollection(
catalogEntity.id,
catalogEntity.getNamespaceName(),
catalogEntity.name,
AlgDataTypeImpl.proto( fieldInfo.build() ) );

} else {
throw new RuntimeException( "Unhandled table type: " + catalogEntity.entityType.name() );
}
Expand Down

0 comments on commit 15ee90f

Please sign in to comment.