PlanStore - Texera/texera GitHub Wiki

Author(s): Seungjin Lee, Kishore Narendran

Reviewer(s): Chen Li ** REVIEWED **

Synopsys

Implement a plan store for pre-defined plans. It manages plans using a table called plan. Plan records, and the JSON strings that describe these plans are stored in the table. The purpose is to use stored plans to make it easier for users to formulate queries using the GUI, and will be eventually used also to store query plans from the TextQL interface.

Status

As of 02/24/2017: UPDATED As of 12/16/2016: FINISHED

Modules

edu.uci.ics.texera.planstore

Related Issues

https://github.com/Texera/texera/issues/256

Description

A table called plan is used in this module. The table has three attributes; name, description, and planJson, all of which are self-explanatory except planJson. The planJson attribute is the logical plan stored as a JSON string. This is how the texera-web module receives query plans. The description for how this JSON should look can be found in this wiki page. This module deals with managing plan records and storing the Query Plans as JSON strings.

Set of public methods in this module is as follows.

  • void getInstance() : get the singleton instance of a plan store.
  • void createPlanStore() : create and initialize a plan store.
  • void destroyPlanStore() : delete both the table and the directory used in this module.
  • IDField addPlan(String planName, String description, String logicalPlanJson) : add a plan with the given name. All the arguments must be non-null.
  • ITuple getPlan(String planName) : get a plan record by the given name.
  • IDataReader getPlanIterator() : get a plan iterator to retrieve all the plan records stored.
  • void deletePlan(String planName) : delete a plan by the given name.
  • void updatePlanDescription(String planName, String description) : update the description of a plan by the given name.
  • void updatePlan(String planName, String logicalPlanJson) : update the logical plan JSON string of a plan by the given name.
  • void updatePlan(String planName, String description, String logicalPlanJson) : update both the plan object and the description of a plan by the given name

Texera Web API endpoints

HTTP Method URL Description
POST /planstore Adding a plan to the PlanStore
GET /planstore Getting all the query plans in the PlanStore
GET /planstore/{plan_name} Getting the query plan associated with the URL parameter plan_name in the PlanStore
PUT /planstore/{plan_name} Updating the query plan associated with the URL parameter plan_name with the information presented in the body of the request
DELETE /planstore/{plan_name} Deleting the query plan associated with the URL parameter plan_name in the PlanStore

TODOs

  • Integrate this module with texera-gui.