-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
1,305 additions
and
906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
core/src/main/java/org/polypheny/db/adapter/DocumentModifyDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Copyright 2019-2023 The Polypheny Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.polypheny.db.adapter; | ||
|
||
import org.polypheny.db.algebra.AlgNode; | ||
import org.polypheny.db.algebra.core.lpg.LpgModify; | ||
import org.polypheny.db.catalog.catalogs.DocStoreCatalog; | ||
import org.polypheny.db.catalog.entity.allocation.AllocationTable; | ||
import org.polypheny.db.catalog.entity.logical.LogicalColumn; | ||
import org.polypheny.db.catalog.entity.logical.LogicalIndex; | ||
import org.polypheny.db.prepare.Context; | ||
import org.polypheny.db.tools.AlgBuilder; | ||
|
||
public class DocumentModifyDelegate extends DocumentScanDelegate implements Modifiable { | ||
|
||
private final Modifiable modifiable; | ||
|
||
|
||
public DocumentModifyDelegate( Modifiable modifiable, DocStoreCatalog catalog ) { | ||
super( modifiable, catalog ); | ||
this.modifiable = modifiable; | ||
} | ||
|
||
|
||
@Override | ||
public AlgNode getGraphModify( long allocId, LpgModify<?> modify, AlgBuilder builder ) { | ||
return null; | ||
} | ||
|
||
|
||
@Override | ||
public void addColumn( Context context, long allocId, LogicalColumn column ) { | ||
modifiable.addColumn( context, allocId, column ); | ||
} | ||
|
||
|
||
@Override | ||
public void dropColumn( Context context, long allocId, long columnId ) { | ||
modifiable.dropColumn( context, allocId, columnId ); | ||
} | ||
|
||
|
||
@Override | ||
public String addIndex( Context context, LogicalIndex logicalIndex, AllocationTable allocation ) { | ||
return modifiable.addIndex( context, logicalIndex, allocation ); | ||
} | ||
|
||
|
||
@Override | ||
public void dropIndex( Context context, LogicalIndex logicalIndex, long allocId ) { | ||
modifiable.dropIndex( context, logicalIndex, allocId ); | ||
} | ||
|
||
|
||
@Override | ||
public void updateColumnType( Context context, long allocId, LogicalColumn column ) { | ||
modifiable.updateColumnType( context, allocId, column ); | ||
} | ||
|
||
} |
102 changes: 102 additions & 0 deletions
102
core/src/main/java/org/polypheny/db/adapter/DocumentScanDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* | ||
* Copyright 2019-2023 The Polypheny Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.polypheny.db.adapter; | ||
|
||
import java.util.List; | ||
import lombok.Getter; | ||
import org.polypheny.db.catalog.catalogs.DocStoreCatalog; | ||
import org.polypheny.db.catalog.entity.allocation.AllocationCollection; | ||
import org.polypheny.db.catalog.entity.allocation.AllocationGraph; | ||
import org.polypheny.db.catalog.entity.allocation.AllocationTableWrapper; | ||
import org.polypheny.db.catalog.entity.logical.LogicalCollection; | ||
import org.polypheny.db.catalog.entity.logical.LogicalGraph; | ||
import org.polypheny.db.catalog.entity.logical.LogicalTableWrapper; | ||
import org.polypheny.db.catalog.entity.physical.PhysicalEntity; | ||
import org.polypheny.db.prepare.Context; | ||
|
||
public class DocumentScanDelegate implements Scannable { | ||
|
||
private final Scannable scannable; | ||
|
||
@Getter | ||
private final DocStoreCatalog catalog; | ||
|
||
|
||
public DocumentScanDelegate( Scannable scannable, DocStoreCatalog catalog ) { | ||
this.scannable = scannable; | ||
this.catalog = catalog; | ||
} | ||
|
||
|
||
@Override | ||
public void createTable( Context context, LogicalTableWrapper logical, AllocationTableWrapper allocation ) { | ||
scannable.createTable( context, logical, allocation ); | ||
} | ||
|
||
|
||
@Override | ||
public void refreshTable( long allocId ) { | ||
scannable.refreshTable( allocId ); | ||
} | ||
|
||
|
||
@Override | ||
public void refreshGraph( long allocId ) { | ||
List<PhysicalEntity> physicals = catalog.getPhysicalsFromAllocs( allocId ); | ||
scannable.refreshTable( physicals.get( 0 ).allocationId ); | ||
scannable.refreshTable( physicals.get( 1 ).allocationId ); | ||
scannable.refreshTable( physicals.get( 2 ).allocationId ); | ||
scannable.refreshTable( physicals.get( 3 ).allocationId ); | ||
} | ||
|
||
|
||
@Override | ||
public void refreshCollection( long allocId ) { | ||
scannable.refreshCollection( allocId ); | ||
} | ||
|
||
|
||
@Override | ||
public void dropTable( Context context, long allocId ) { | ||
scannable.dropTable( context, allocId ); | ||
} | ||
|
||
|
||
@Override | ||
public void createGraph( Context context, LogicalGraph logical, AllocationGraph allocation ) { | ||
scannable.createGraph( context, logical, allocation ); | ||
} | ||
|
||
|
||
@Override | ||
public void dropGraph( Context context, AllocationGraph allocation ) { | ||
scannable.dropGraph( context, allocation ); | ||
} | ||
|
||
|
||
@Override | ||
public void createCollection( Context context, LogicalCollection logical, AllocationCollection allocation ) { | ||
scannable.createCollection( context, logical, allocation ); | ||
} | ||
|
||
|
||
@Override | ||
public void dropCollection( Context context, AllocationCollection allocation ) { | ||
scannable.dropCollection( context, allocation ); | ||
} | ||
|
||
} |
Oops, something went wrong.