Skip to content

Commit

Permalink
preparation to pass the data
Browse files Browse the repository at this point in the history
  • Loading branch information
flurfis committed Nov 7, 2023
1 parent 191c6b4 commit 46472ba
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 3 deletions.
14 changes: 11 additions & 3 deletions dbms/src/main/java/org/polypheny/db/backup/BackupManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import lombok.extern.slf4j.Slf4j;
import org.polypheny.db.backup.datagatherer.GatherEntries;
import org.polypheny.db.backup.datagatherer.GatherSchema;
import org.polypheny.db.backup.datainserter.EnterSchema;
import org.polypheny.db.catalog.exceptions.GenericRuntimeException;
import org.polypheny.db.information.*;
import org.slf4j.Logger;


@Slf4j
Expand Down Expand Up @@ -53,7 +53,8 @@ public BackupManager() {

InformationAction startBackupAction = new InformationAction( informationGroupOverview, "Start", parameters -> {
//IndexManager.getInstance().resetCounters();
StartDataGathering();
startDataGathering();
System.out.println("gather");
return "Successfully started backup";
} );
startBackupAction.setOrder( 2 );
Expand All @@ -66,6 +67,7 @@ public BackupManager() {

InformationAction insertBackupDataAction = new InformationAction( informationGroupOverview, "Insert", parameters -> {
//IndexManager.getInstance().resetCounters();
startInserting();
System.out.println("hii");
return "Successfully inserted backup data";
} );
Expand All @@ -82,7 +84,7 @@ public static BackupManager setAndGetInstance( BackupManager backupManager ) {
return INSTANCE;
}

public void StartDataGathering () {
public void startDataGathering() {
//GatherEntries gatherEntries = new GatherEntries();
GatherSchema gatherSchema = new GatherSchema();

Expand All @@ -91,4 +93,10 @@ public void StartDataGathering () {
}


private void startInserting() {
EnterSchema enterSchema = new EnterSchema();

enterSchema.start();
}

}
66 changes: 66 additions & 0 deletions dbms/src/main/java/org/polypheny/db/backup/InformationObject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* 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.backup;

import com.google.common.collect.ImmutableMap;
import lombok.Getter;
import lombok.Setter;
import org.polypheny.db.catalog.entity.LogicalConstraint;
import org.polypheny.db.catalog.entity.logical.*;

import java.util.List;

public class InformationObject {

//ImmutableMap<Long, LogicalNamespace> namespaces;
@Getter @Setter
List<LogicalNamespace> namespaces;
@Getter @Setter
List<LogicalNamespace> relNamespaces;
@Getter @Setter
List<LogicalNamespace> graphNamespaces;
@Getter @Setter
List<LogicalNamespace> docNamespaces;
//TODO(FF): adjust
@Getter @Setter
List<LogicalView> views;
@Getter @Setter
List<LogicalMaterializedView> materializedViews;
//namespace id, list of tables for the namespace
@Getter @Setter
ImmutableMap<Long, List<LogicalTable>> tables;

@Getter @Setter
ImmutableMap<Long, List<LogicalCollection>> collections;
@Getter @Setter
ImmutableMap<Long, LogicalGraph> graphs;

//table id, list of views for the table
ImmutableMap<Long, List<LogicalColumn>> columns;
ImmutableMap<Long, List<LogicalPrimaryKey>> primaryKeysPerTable;
ImmutableMap<Long, List<LogicalForeignKey>> foreignKeysPerTable;
//ImmutableMap<Long, List<LogicalKey>> keysPerTable;
// uufspliite en pk, fk, constraints, indexes
// index -> can only be created per (one) table
ImmutableMap<Long, List<LogicalIndex>> logicalIndexes;
//TODO(FF): if there exist constraint that go over several tables, need other way to signify it... rather use constraints per table, not per namespace! (but gets the right amount of constraints) --> constr only 1 table (?), views can be sever tables
ImmutableMap<Long, List<LogicalConstraint>> constraints;

Boolean collectedRel = false;
Boolean collectedDoc = false;
Boolean collectedGraph = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,15 @@

package org.polypheny.db.backup.datainserter;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class EnterSchema {

public EnterSchema() {
}

public void start() {
log.debug( "insert schemas" );
}
}

0 comments on commit 46472ba

Please sign in to comment.