dzitkowskik / mini-dos

Project for Distributed Operating Systems at Warsaw University of Technology (Mathematics and Computer Science department) Winter 2015
Apache License 2.0
0 stars 0 forks source link

Master - Create table statements #43

Closed dzitkowskik closed 8 years ago

dzitkowskik commented 8 years ago

There is a requirement to get a create table sql to create table with particular name in in memory db. Master is storing this sql statements so it can expose method in his RMI interface to get this data. So node sends table name/names and master responses with sql to create that table.

(*) this is the point of this issue

Select process will look like that:

  1. Get create table statements from master for needed tables (*)
  2. Create them in in memory database
  3. Execute selects (select * from ) in all nodes pointed by master (these which contain that data) for all needed tables
  4. Serialize somehow ResultSets and send it to coordinating node
  5. Coordinating node inserts (unserialized data) to created tables in in memory db performing distinct on our internal id
  6. Perform sql query (our SELECT from client) on in memory db, then return result
  7. davidmigloz commented 8 years ago

    Maybe steps 1 and 2 can be joined. So when node calls selectMetadata() of master, it returns the list of create table statements and the nodes which have the data. So we perform one less call.

    dzitkowskik commented 8 years ago

    Yes this is a good idea:)

    davidmigloz commented 8 years ago

    When master's selectMetadata() method is called with a list of tables, master get all the create tables of these tables and all the nodes which have data of these tables. It returns two list, one with the create table statements and other with the interfaces of the nodes. Possible return errors:

    • ErrorEnum.ANOTHER_ERROR the list of tables is empty.
    • ErrorEnum.TABLE_NOT_EXIST some table of the list is not registered in master.

    Task ready.