Presto
Presto is an open-source distributed SQL query engine designed for running fast, interactive analytics on large datasets. It supports querying data from a variety of sources such as Hive, Cassandra, relational databases, and proprietary data stores. When integrated with Martini Runtime, Presto’s capabilities can be utilized to query large-scale datasets efficiently within a unified execution environment.
Configuring Presto
To configure Martini Runtime to connect to Presto, you need to set up a JDBC connection. This allows seamless interaction between the system and Presto, enabling the execution of queries and retrieval of data for analytics. Here's a simple guide to adding a new database connection:
Configuration Guide
Via API Explorer:
Database connections can be configured using the Martini API Explorer, a user-friendly interface for interacting with the system's APIs. Follow these steps to configure Presto database connections through the API Explorer:
-
Access the API Explorer:
Open a web browser and navigate to[HOST]:8080/api-explorer/
to access the API Explorer. -
Navigate to the Database Tag:
Locate and click on thedatabase
tag within the API Explorer to explore the database configuration and operation endpoints. -
Configure Connection Pool:
Use theesbapi/databases
endpoint under the database tag to configure and save a new database connection pool. -
Use POST to Save a Connection Pool:
Use the POST method at/esbapi/databases
to save the connection pool. Below is an example of a minimum JSON payload to define a Presto connection:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
{ "name": "[name]", "autoStart": true, "status": "STARTED", "type": "jdbc", "url": "jdbc:presto://[HOST]:[PORT]", "xa": false, "driverClassName": "com.facebook.presto.jdbc.PrestoDriver", "username": "[username]", "password": "[password]", "acquireIncrement": 1, "acquisitionInterval": 1, "acquisitionTimeout": 30, "allowLocalTransactions": true, "autoCommit": true, "applyTransactionTimeout": false, "automaticEnlistingEnabled": true, "deferConnectionRelease": false, "enableJdbc4ConnectionTest": false, "ignoreRecoveryFailures": false, "isolationLevel": "READ_COMMITTED", "maxIdleTime": 60, "minPoolSize": 0, "maxPoolSize": 5, "preparedStatementCacheSize": 0, "shareTransactionConnections": false, "twoPcOrderingPosition": 0, "useTmJoin": true, "loginTimeout": 0 }
url
: Replace[HOST]
and[PORT]
with your Presto server host and port (default 8080).driverClassName
: Specifies the JDBC driver class for Presto.username
: Provide your Presto username.password
: Provide the corresponding password.
Via File System:
Alternatively, database connections can be configured directly in the file system by editing the <name>.dbxml
file located in the /<martini-home>/conf/db-pool/
directory.
Follow these steps to modify Presto database connections directly through the file system:
-
Locate the Configuration File:
Navigate to the/<martini-home>/conf/db-pool/
directory on your server and find the<name>.dbxml
file that corresponds to your Presto configuration. -
Edit the Database Connections:
Open the<name>.dbxml
file in a text editor and modify the Presto connection properties. -
Save and Restart:
After editing the file, save the changes and restart the Martini Runtime instance.
Here is an example of the minimum dbXML configuration for Presto:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
Configuring Presto in Martini Designer
- In the Martini Designer's Navigator view, click on the Database icon to view available database connections.
- Right-click on Connections, and choose the option to add a new database connection.
- Specify a name for the connection and select the database type as JDBC.
- Fill in the required database connection details (host, port, username, password).
- Save the changes to establish the connection.
Connection Properties
For more details on constructing a JDBC connection URL for Presto, refer to the official Presto documentation: JDBC Connection URL Reference.
Database Properties
These properties are used to control various aspects of database behavior. For detailed information on configuring JDBC properties for Presto, refer to the Configuring JDBC on Martini Server Runtime Documentation.