Skip to content

Commit

Permalink
Add unix listener in .polypheny folder
Browse files Browse the repository at this point in the history
This is a convenience feature in development and test mode
  • Loading branch information
gartens committed Mar 27, 2024
1 parent 6773b1e commit ab7db15
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dbms/src/main/java/org/polypheny/db/PolyphenyDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.UUID;
import javax.inject.Inject;
Expand Down Expand Up @@ -446,6 +447,18 @@ public void join( final long millis ) throws InterruptedException {

restore( authenticator, catalog );

// For convenience, try to start a unix listener directly in the .polypheny folder
if ( Catalog.mode == RunMode.TEST || Catalog.mode == RunMode.DEVELOPMENT ) {
try {
QueryInterfaceManager.getInstance().createQueryInterface( "Proto Interface (Unix transport)",
"proto-interface-homedir-unix",
Map.of( "path", PolyphenyHomeDirManager.getInstance().registerNewGlobalFile( "polypheny-proto.sock" ).getAbsolutePath() ) );
} catch ( Throwable t ) {
// As this is a convenience feature, we do not abort if it fails
log.info( "Could not start homedir unix listener: " + t.getMessage() );
}
}

// Add tracker, which rechecks constraints after enabling
ConstraintTracker tracker = new ConstraintTracker( transactionManager );
RuntimeConfig.FOREIGN_KEY_ENFORCEMENT.addObserver( tracker );
Expand Down

0 comments on commit ab7db15

Please sign in to comment.