make metadata storage pluggable

Ok, now that we have support for Derby, we should add tests that execute
all operations against an embedded database so we have proper tests in
place.

On Wed, Oct 29, 2014 at 12:46 PM, jisookim0513 <notifications@github.com>
wrote:

> In server/src/main/java/io/druid/db/SQLMetadataConnector.java:
>
> > +    );
> > +  }
> > +
> > +  public void createSegmentTable(final IDBI dbi, final String tableName)
> > +  {
> > +    createTable(
> > +        dbi,
> > +        tableName,
> > +        String.format(
> > +            "CREATE table %s (id VARCHAR(255) NOT NULL, dataSource VARCHAR(255) NOT NULL, created_date VARCHAR(255) NOT NULL, "
> > +            + "start VARCHAR(255) NOT NULL, \"end\" VARCHAR(255) NOT NULL, partitioned SMALLINT NOT NULL, version VARCHAR(255) NOT NULL, "
> > +            + "used BOOLEAN NOT NULL, payload CLOB NOT NULL, PRIMARY KEY (id))",
> > +            tableName
> > +        )
> > +    );
> > +    createIndex(dbi, tableName, "segment_dataSource", "dataSource");
>
> I wanted to leave it as part of the table creation statement, but derby
> didn't let me do it.. It was not possible to make multiple statements at
> the same time.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/metamx/druid/pull/758/files#r19566509>.
>