@SuppressWarnings("resource") @Test public void ShowTimeseriesInJson() throws Exception { String metadataInJson = "=== Timeseries Tree ===\n" + "\n" + "root:{\n" + " vehicle:{\n" + " d0:{\n" + " s0:{\n" + " DataType: INT32,\n" + " Encoding: RLE,\n" + " args: {},\n" + " StorageGroup: root.vehicle \n" + " },\n" + " s1:{\n" + " DataType: INT64,\n" + " Encoding: RLE,\n" + " args: {},\n" + " StorageGroup: root.vehicle \n" + " },\n" + " s2:{\n" + " DataType: FLOAT,\n" + " Encoding: RLE,\n" + " args: {},\n" + " StorageGroup: root.vehicle \n" + " }\n" + " }\n" + " }\n" + "}"; when(fetchMetadataResp.getMetadataInJson()).thenReturn(metadataInJson); String res = ((IoTDBDatabaseMetadata) databaseMetaData).getMetadataInJson(); assertEquals(metadataInJson, res); }
public String getMetadataInJson() throws SQLException { try { return getMetadataInJsonFunc(); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; if (flag) { try { return getMetadataInJsonFunc(); } catch (TException e2) { throw new SQLException("Failed to fetch all metadata in json " + "after reconnecting. Please check the server status."); } } else { throw new SQLException("Failed to reconnect to the server " + "when fetching all metadata in json. Please check the server status."); } } }
IoTDBDatabaseMetadata implements DatabaseMetaData { public String getMetadataInJson() throws SQLException { try { return getMetadataInJsonFunc(); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; if (flag) { try { return getMetadataInJsonFunc(); } catch (TException e2) { throw new SQLException("Failed to fetch all metadata in json " + "after reconnecting. Please check the server status."); } } else { throw new SQLException("Failed to reconnect to the server " + "when fetching all metadata in json. Please check the server status."); } } } }
IoTDBDatabaseMetadata implements DatabaseMetaData { public String getMetadataInJson() throws SQLException { try { return getMetadataInJsonFunc(); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; if (flag) { try { return getMetadataInJsonFunc(); } catch (TException e2) { throw new SQLException("Failed to fetch all metadata in json " + "after reconnecting. Please check the server status."); } } else { throw new SQLException("Failed to reconnect to the server " + "when fetching all metadata in json. Please check the server status."); } } } IoTDBDatabaseMetadata(IoTDBConnection connection, TSIService.Iface client); }
IoTDBDatabaseMetadata implements DatabaseMetaData { public String getMetadataInJson() throws SQLException { try { return getMetadataInJsonFunc(); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; if (flag) { try { return getMetadataInJsonFunc(); } catch (TException e2) { throw new SQLException("Failed to fetch all metadata in json " + "after reconnecting. Please check the server status."); } } else { throw new SQLException("Failed to reconnect to the server " + "when fetching all metadata in json. Please check the server status."); } } } IoTDBDatabaseMetadata(IoTDBConnection connection, TSIService.Iface client); @Override ResultSet getColumns(String catalog, String schemaPattern, String columnPattern,
      String devicePattern); @Override boolean isWrapperFor(Class<?> arg0); @Override T unwrap(Class<T> iface); @Override boolean allProceduresAreCallable(); @Override boolean allTablesAreSelectable(); @Override boolean autoCommitFailureClosesAllResultSets(); @Override boolean dataDefinitionCausesTransactionCommit(); @Override boolean dataDefinitionIgnoredInTransactions(); @Override boolean deletesAreDetected(int arg0); @Override boolean doesMaxRowSizeIncludeBlobs(); @Override boolean generatedKeyAlwaysReturned(); @Override ResultSet getAttributes(String arg0, String arg1, String arg2, String arg3); @Override ResultSet getBestRowIdentifier(String arg0, String arg1, String arg2, int arg3,
      boolean arg4); @Override String getCatalogSeparator(); @Override String getCatalogTerm(); @Override ResultSet getCatalogs(); @Override ResultSet getClientInfoProperties(); @Override ResultSet getColumnPrivileges(String arg0, String arg1, String arg2,
      String arg3); @Override Connection getConnection(); @Override ResultSet getCrossReference(String arg0, String arg1, String arg2, String arg3,
      String arg4, String arg5); @Override int getDatabaseMajorVersion(); @Override int getDatabaseMinorVersion(); @Override String getDatabaseProductName(); @Override String getDatabaseProductVersion(); @Override int getDefaultTransactionIsolation(); @Override int getDriverMajorVersion(); @Override int getDriverMinorVersion(); @Override String getDriverName(); @Override String getDriverVersion(); @Override ResultSet getExportedKeys(String arg0, String arg1, String arg2); @Override String getExtraNameCharacters(); @Override ResultSet getFunctionColumns(String arg0, String arg1, String arg2, String arg3); @Override ResultSet getFunctions(String arg0, String arg1, String arg2); @Override String getIdentifierQuoteString(); @Override ResultSet getImportedKeys(String arg0, String arg1, String arg2); @Override ResultSet getIndexInfo(String arg0, String arg1, String arg2, boolean arg3, boolean arg4); @Override int getJDBCMajorVersion(); @Override int getJDBCMinorVersion(); @Override int getMaxBinaryLiteralLength(); @Override int getMaxCatalogNameLength(); @Override int getMaxCharLiteralLength(); @Override int getMaxColumnNameLength(); @Override int getMaxColumnsInGroupBy(); @Override int getMaxColumnsInIndex(); @Override int getMaxColumnsInOrderBy(); @Override int getMaxColumnsInSelect(); @Override int getMaxColumnsInTable(); @Override int getMaxConnections(); @Override int getMaxCursorNameLength(); @Override int getMaxIndexLength(); @Override int getMaxProcedureNameLength(); @Override int getMaxRowSize(); @Override int getMaxSchemaNameLength(); @Override int getMaxStatementLength(); @Override int getMaxStatements(); @Override int getMaxTableNameLength(); @Override int getMaxTablesInSelect(); @Override int getMaxUserNameLength(); @Override String getNumericFunctions(); @Override ResultSet getPrimaryKeys(String arg0, String arg1, String arg2); @Override ResultSet getProcedureColumns(String arg0, String arg1, String arg2, String arg3); @Override String getProcedureTerm(); @Override ResultSet getProcedures(String arg0, String arg1, String arg2); @Override ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern,
      String columnNamePattern); @Override int getResultSetHoldability(); @Override RowIdLifetime getRowIdLifetime(); @Override String getSQLKeywords(); @Override int getSQLStateType(); @Override String getSchemaTerm(); @Override ResultSet getSchemas(); @Override ResultSet getSchemas(String catalog, String schemaPattern); @Override String getSearchStringEscape(); @Override String getStringFunctions(); @Override ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern); @Override ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern); @Override String getSystemFunctions(); @Override ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern); @Override ResultSet getTableTypes(); @Override ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern,
      String[] types); @Override String getTimeDateFunctions(); @Override ResultSet getTypeInfo(); @Override ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern,
      int[] types); @Override String getURL(); @Override String getUserName(); @Override ResultSet getVersionColumns(String catalog, String schema, String table); @Override boolean insertsAreDetected(int type); @Override boolean isCatalogAtStart(); @Override boolean isReadOnly(); @Override boolean locatorsUpdateCopy(); @Override boolean nullPlusNonNullIsNull(); @Override boolean nullsAreSortedAtEnd(); @Override boolean nullsAreSortedAtStart(); @Override boolean nullsAreSortedHigh(); @Override boolean nullsAreSortedLow(); @Override boolean othersDeletesAreVisible(int type); @Override boolean othersInsertsAreVisible(int type); @Override boolean othersUpdatesAreVisible(int type); @Override boolean ownDeletesAreVisible(int type); @Override boolean ownInsertsAreVisible(int type); @Override boolean ownUpdatesAreVisible(int type); @Override boolean storesLowerCaseIdentifiers(); @Override boolean storesLowerCaseQuotedIdentifiers(); @Override boolean storesMixedCaseIdentifiers(); @Override boolean storesMixedCaseQuotedIdentifiers(); @Override boolean storesUpperCaseIdentifiers(); @Override boolean storesUpperCaseQuotedIdentifiers(); @Override boolean supportsANSI92EntryLevelSQL(); @Override boolean supportsANSI92FullSQL(); @Override boolean supportsANSI92IntermediateSQL(); @Override boolean supportsAlterTableWithAddColumn(); @Override boolean supportsAlterTableWithDropColumn(); @Override boolean supportsBatchUpdates(); @Override boolean supportsCatalogsInDataManipulation(); @Override boolean supportsCatalogsInIndexDefinitions(); @Override boolean supportsCatalogsInPrivilegeDefinitions(); @Override boolean supportsCatalogsInProcedureCalls(); @Override boolean supportsCatalogsInTableDefinitions(); @Override boolean supportsColumnAliasing(); @Override boolean supportsConvert(); @Override boolean supportsConvert(int fromType, int toType); @Override boolean supportsCoreSQLGrammar(); @Override boolean supportsCorrelatedSubqueries(); @Override boolean supportsDataDefinitionAndDataManipulationTransactions(); @Override boolean supportsDataManipulationTransactionsOnly(); @Override boolean supportsDifferentTableCorrelationNames(); @Override boolean supportsExpressionsInOrderBy(); @Override boolean supportsExtendedSQLGrammar(); @Override boolean supportsFullOuterJoins(); @Override boolean supportsGetGeneratedKeys(); @Override boolean supportsGroupBy(); @Override boolean supportsGroupByBeyondSelect(); @Override boolean supportsGroupByUnrelated(); @Override boolean supportsIntegrityEnhancementFacility(); @Override boolean supportsLikeEscapeClause(); @Override boolean supportsLimitedOuterJoins(); @Override boolean supportsMinimumSQLGrammar(); @Override boolean supportsMixedCaseIdentifiers(); @Override boolean supportsMixedCaseQuotedIdentifiers(); @Override boolean supportsMultipleOpenResults(); @Override boolean supportsMultipleResultSets(); @Override boolean supportsMultipleTransactions(); @Override boolean supportsNamedParameters(); @Override boolean supportsNonNullableColumns(); @Override boolean supportsOpenCursorsAcrossCommit(); @Override boolean supportsOpenCursorsAcrossRollback(); @Override boolean supportsOpenStatementsAcrossCommit(); @Override boolean supportsOpenStatementsAcrossRollback(); @Override boolean supportsOrderByUnrelated(); @Override boolean supportsOuterJoins(); @Override boolean supportsPositionedDelete(); @Override boolean supportsPositionedUpdate(); @Override boolean supportsResultSetConcurrency(int type, int concurrency); @Override boolean supportsResultSetHoldability(int holdability); @Override boolean supportsResultSetType(int type); @Override boolean supportsSavepoints(); @Override boolean supportsSchemasInDataManipulation(); @Override boolean supportsSchemasInIndexDefinitions(); @Override boolean supportsSchemasInPrivilegeDefinitions(); @Override boolean supportsSchemasInProcedureCalls(); @Override boolean supportsSchemasInTableDefinitions(); @Override boolean supportsSelectForUpdate(); @Override boolean supportsStatementPooling(); @Override boolean supportsStoredFunctionsUsingCallSyntax(); @Override boolean supportsStoredProcedures(); @Override boolean supportsSubqueriesInComparisons(); @Override boolean supportsSubqueriesInExists(); @Override boolean supportsSubqueriesInIns(); @Override boolean supportsSubqueriesInQuantifieds(); @Override boolean supportsTableCorrelationNames(); @Override boolean supportsTransactionIsolationLevel(int level); @Override boolean supportsTransactions(); @Override boolean supportsUnion(); @Override boolean supportsUnionAll(); @Override boolean updatesAreDetected(int type); @Override boolean usesLocalFilePerTable(); @Override boolean usesLocalFiles(); @Deprecated @Override String toString(); String getMetadataInJson(); }
IoTDBDatabaseMetadata implements DatabaseMetaData { public String getMetadataInJson() throws SQLException { try { return getMetadataInJsonFunc(); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; if (flag) { try { return getMetadataInJsonFunc(); } catch (TException e2) { throw new SQLException("Failed to fetch all metadata in json " + "after reconnecting. Please check the server status."); } } else { throw new SQLException("Failed to reconnect to the server " + "when fetching all metadata in json. Please check the server status."); } } } IoTDBDatabaseMetadata(IoTDBConnection connection, TSIService.Iface client); @Override ResultSet getColumns(String catalog, String schemaPattern, String columnPattern,
      String devicePattern); @Override boolean isWrapperFor(Class<?> arg0); @Override T unwrap(Class<T> iface); @Override boolean allProceduresAreCallable(); @Override boolean allTablesAreSelectable(); @Override boolean autoCommitFailureClosesAllResultSets(); @Override boolean dataDefinitionCausesTransactionCommit(); @Override boolean dataDefinitionIgnoredInTransactions(); @Override boolean deletesAreDetected(int arg0); @Override boolean doesMaxRowSizeIncludeBlobs(); @Override boolean generatedKeyAlwaysReturned(); @Override ResultSet getAttributes(String arg0, String arg1, String arg2, String arg3); @Override ResultSet getBestRowIdentifier(String arg0, String arg1, String arg2, int arg3,
      boolean arg4); @Override String getCatalogSeparator(); @Override String getCatalogTerm(); @Override ResultSet getCatalogs(); @Override ResultSet getClientInfoProperties(); @Override ResultSet getColumnPrivileges(String arg0, String arg1, String arg2,
      String arg3); @Override Connection getConnection(); @Override ResultSet getCrossReference(String arg0, String arg1, String arg2, String arg3,
      String arg4, String arg5); @Override int getDatabaseMajorVersion(); @Override int getDatabaseMinorVersion(); @Override String getDatabaseProductName(); @Override String getDatabaseProductVersion(); @Override int getDefaultTransactionIsolation(); @Override int getDriverMajorVersion(); @Override int getDriverMinorVersion(); @Override String getDriverName(); @Override String getDriverVersion(); @Override ResultSet getExportedKeys(String arg0, String arg1, String arg2); @Override String getExtraNameCharacters(); @Override ResultSet getFunctionColumns(String arg0, String arg1, String arg2, String arg3); @Override ResultSet getFunctions(String arg0, String arg1, String arg2); @Override String getIdentifierQuoteString(); @Override ResultSet getImportedKeys(String arg0, String arg1, String arg2); @Override ResultSet getIndexInfo(String arg0, String arg1, String arg2, boolean arg3, boolean arg4); @Override int getJDBCMajorVersion(); @Override int getJDBCMinorVersion(); @Override int getMaxBinaryLiteralLength(); @Override int getMaxCatalogNameLength(); @Override int getMaxCharLiteralLength(); @Override int getMaxColumnNameLength(); @Override int getMaxColumnsInGroupBy(); @Override int getMaxColumnsInIndex(); @Override int getMaxColumnsInOrderBy(); @Override int getMaxColumnsInSelect(); @Override int getMaxColumnsInTable(); @Override int getMaxConnections(); @Override int getMaxCursorNameLength(); @Override int getMaxIndexLength(); @Override int getMaxProcedureNameLength(); @Override int getMaxRowSize(); @Override int getMaxSchemaNameLength(); @Override int getMaxStatementLength(); @Override int getMaxStatements(); @Override int getMaxTableNameLength(); @Override int getMaxTablesInSelect(); @Override int getMaxUserNameLength(); @Override String getNumericFunctions(); @Override ResultSet getPrimaryKeys(String arg0, String arg1, String arg2); @Override ResultSet getProcedureColumns(String arg0, String arg1, String arg2, String arg3); @Override String getProcedureTerm(); @Override ResultSet getProcedures(String arg0, String arg1, String arg2); @Override ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern,
      String columnNamePattern); @Override int getResultSetHoldability(); @Override RowIdLifetime getRowIdLifetime(); @Override String getSQLKeywords(); @Override int getSQLStateType(); @Override String getSchemaTerm(); @Override ResultSet getSchemas(); @Override ResultSet getSchemas(String catalog, String schemaPattern); @Override String getSearchStringEscape(); @Override String getStringFunctions(); @Override ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern); @Override ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern); @Override String getSystemFunctions(); @Override ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern); @Override ResultSet getTableTypes(); @Override ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern,
      String[] types); @Override String getTimeDateFunctions(); @Override ResultSet getTypeInfo(); @Override ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern,
      int[] types); @Override String getURL(); @Override String getUserName(); @Override ResultSet getVersionColumns(String catalog, String schema, String table); @Override boolean insertsAreDetected(int type); @Override boolean isCatalogAtStart(); @Override boolean isReadOnly(); @Override boolean locatorsUpdateCopy(); @Override boolean nullPlusNonNullIsNull(); @Override boolean nullsAreSortedAtEnd(); @Override boolean nullsAreSortedAtStart(); @Override boolean nullsAreSortedHigh(); @Override boolean nullsAreSortedLow(); @Override boolean othersDeletesAreVisible(int type); @Override boolean othersInsertsAreVisible(int type); @Override boolean othersUpdatesAreVisible(int type); @Override boolean ownDeletesAreVisible(int type); @Override boolean ownInsertsAreVisible(int type); @Override boolean ownUpdatesAreVisible(int type); @Override boolean storesLowerCaseIdentifiers(); @Override boolean storesLowerCaseQuotedIdentifiers(); @Override boolean storesMixedCaseIdentifiers(); @Override boolean storesMixedCaseQuotedIdentifiers(); @Override boolean storesUpperCaseIdentifiers(); @Override boolean storesUpperCaseQuotedIdentifiers(); @Override boolean supportsANSI92EntryLevelSQL(); @Override boolean supportsANSI92FullSQL(); @Override boolean supportsANSI92IntermediateSQL(); @Override boolean supportsAlterTableWithAddColumn(); @Override boolean supportsAlterTableWithDropColumn(); @Override boolean supportsBatchUpdates(); @Override boolean supportsCatalogsInDataManipulation(); @Override boolean supportsCatalogsInIndexDefinitions(); @Override boolean supportsCatalogsInPrivilegeDefinitions(); @Override boolean supportsCatalogsInProcedureCalls(); @Override boolean supportsCatalogsInTableDefinitions(); @Override boolean supportsColumnAliasing(); @Override boolean supportsConvert(); @Override boolean supportsConvert(int fromType, int toType); @Override boolean supportsCoreSQLGrammar(); @Override boolean supportsCorrelatedSubqueries(); @Override boolean supportsDataDefinitionAndDataManipulationTransactions(); @Override boolean supportsDataManipulationTransactionsOnly(); @Override boolean supportsDifferentTableCorrelationNames(); @Override boolean supportsExpressionsInOrderBy(); @Override boolean supportsExtendedSQLGrammar(); @Override boolean supportsFullOuterJoins(); @Override boolean supportsGetGeneratedKeys(); @Override boolean supportsGroupBy(); @Override boolean supportsGroupByBeyondSelect(); @Override boolean supportsGroupByUnrelated(); @Override boolean supportsIntegrityEnhancementFacility(); @Override boolean supportsLikeEscapeClause(); @Override boolean supportsLimitedOuterJoins(); @Override boolean supportsMinimumSQLGrammar(); @Override boolean supportsMixedCaseIdentifiers(); @Override boolean supportsMixedCaseQuotedIdentifiers(); @Override boolean supportsMultipleOpenResults(); @Override boolean supportsMultipleResultSets(); @Override boolean supportsMultipleTransactions(); @Override boolean supportsNamedParameters(); @Override boolean supportsNonNullableColumns(); @Override boolean supportsOpenCursorsAcrossCommit(); @Override boolean supportsOpenCursorsAcrossRollback(); @Override boolean supportsOpenStatementsAcrossCommit(); @Override boolean supportsOpenStatementsAcrossRollback(); @Override boolean supportsOrderByUnrelated(); @Override boolean supportsOuterJoins(); @Override boolean supportsPositionedDelete(); @Override boolean supportsPositionedUpdate(); @Override boolean supportsResultSetConcurrency(int type, int concurrency); @Override boolean supportsResultSetHoldability(int holdability); @Override boolean supportsResultSetType(int type); @Override boolean supportsSavepoints(); @Override boolean supportsSchemasInDataManipulation(); @Override boolean supportsSchemasInIndexDefinitions(); @Override boolean supportsSchemasInPrivilegeDefinitions(); @Override boolean supportsSchemasInProcedureCalls(); @Override boolean supportsSchemasInTableDefinitions(); @Override boolean supportsSelectForUpdate(); @Override boolean supportsStatementPooling(); @Override boolean supportsStoredFunctionsUsingCallSyntax(); @Override boolean supportsStoredProcedures(); @Override boolean supportsSubqueriesInComparisons(); @Override boolean supportsSubqueriesInExists(); @Override boolean supportsSubqueriesInIns(); @Override boolean supportsSubqueriesInQuantifieds(); @Override boolean supportsTableCorrelationNames(); @Override boolean supportsTransactionIsolationLevel(int level); @Override boolean supportsTransactions(); @Override boolean supportsUnion(); @Override boolean supportsUnionAll(); @Override boolean updatesAreDetected(int type); @Override boolean usesLocalFilePerTable(); @Override boolean usesLocalFiles(); @Deprecated @Override String toString(); String getMetadataInJson();  }