private String readSchemaName(ResultSet rs, DbmsType dbmsType) throws SQLException { final String schemaName = rs.getString(dbmsType.getResultSetTableSchema()); String catalogName = ""; try { // This column is not there for Oracle so handle it // gracefully.... catalogName = rs.getString("TABLE_CATALOG"); } catch (final SQLException ex) { LOGGER.info("TABLE_CATALOG not in result set."); } return Optional.ofNullable(schemaName).orElse(catalogName); }
public static Properties loadProperties(Logger logger, File configFile) { final Properties properties = new Properties(); if (configFile.exists() && configFile.canRead()) { try (final InputStream in = new FileInputStream(configFile)) { properties.load(in); } catch (final IOException ex) { final String err = "Error loading default settings from " + configFile.getAbsolutePath() + "-file."; logger.error(ex, err); throw new RuntimeException(err, ex); } } else { logger.info( "No configuration file '" + configFile.getAbsolutePath() + "' found." ); } return properties; }
private void printStreamSupplierOrder(Injector injector) { injector.get(StreamSupplierComponent.class).ifPresent(root -> { if (root.sourceStreamSupplierComponents().findAny().isPresent()) { LOGGER.info("Current " + StreamSupplierComponent.class.getSimpleName() + " hierarchy:"); printStreamSupplierOrder(root, 0); } }); }
return value; } else if (value.isEmpty()) { LOGGER.info("An enum field cannot be empty. Please remove the field instead."); return labelString; .forEach(elem -> duplicate.set(true)); if (duplicate.get()){ LOGGER.info("Enum cannot contain the same constant twice"); return labelString; LOGGER.info("Enum should only contain letters, number, underscore and/or dashes"); return labelString;
private void printStreamSupplierOrder(StreamSupplierComponent ssc, int level) { LOGGER.info("%s%s (0x%08x) %s", indent(level), ssc.getClass().getSimpleName(), ssc.hashCode(), ssc.isImmutable() ? "mutable" : "immutable"); ssc.sourceStreamSupplierComponents() .forEachOrdered(child -> printStreamSupplierOrder(child, level + 1)); }
private <T> T readSilent(ResultSet rs, SqlSupplier<T> supplier, boolean fullWarning) { try { final T result = supplier.get(); if (rs.wasNull()) { return null; } else { return result; } } catch (SQLException sqle) { // ignore, just return null if (fullWarning) { LOGGER.warn(sqle, "Unable to read column metadata: " + sqle.getMessage()); } else { LOGGER.info("Metadata not supported: " + sqle.getMessage()); } } return null; }
final Project project = projectMutator.document(); LOGGER.info("clearing tables"); project.dbmses().forEach(dbms -> { LOGGER.info("dbms: " + dbms.getName()); dbms.schemas().forEach(schema -> { LOGGER.info("schema: " + schema.getName()); if (schema.getData().containsKey("tables")) { LOGGER.info("Removing " + schema.tables().count()); schema.getData().remove("tables"); } else { LOGGER.info("No tables to remove");
progress.setCurrentAction("Done!"); LOGGER.info("Aggregate duration of metadata retrieval [ms]: " + timers.entrySet().stream() .map(e -> String.format("%s=%,d", e.getKey().getSimpleName(), e.getValue().get()))
LOGGER.info("Wrote %d files in %s", getFilesCreated(), paths.packageLocation());
resultSetMutator.mutate(child, rsChild); } else { LOGGER.info("Skipped due to RS filtering. This is normal " + "for some DBMS types.");
+ ":: (v" + version + ") \n"; LOGGER.info(speedmentMsg); " (" + info.getSpecificationNickname() + ")" + ", License: " + info.getLicenseName(); LOGGER.info(msg); if (!info.isProductionMode()) { LOGGER.warn("This version is NOT INTENDED FOR PRODUCTION USE!"); LOGGER.info("Upstream version is " + upstreamInfo.getImplementationVersion() + " (" + upstreamInfo.getSpecificationNickname() + ")"); if (!upstreamInfo.isProductionMode()) { LOGGER.warn("Upstream version is NOT INTENDED FOR PRODUCTION USE!"); LOGGER.info(javaMsg); LOGGER.info("Unknown Java version."); LOGGER.info( "Available processors: %d, Max Memory: %,d bytes", Runtime.getRuntime().availableProcessors(),
LOGGER.info(action); progressListener.setCurrentAction(action);
)); LOGGER.info(String.format( "Reloading from dbms '%s' on %s:%d.", dbms.getName(),
final String action = actionName(dbms); LOGGER.info(action); progress.setCurrentAction(action);
protected void checkDatabaseConnectivity(Injector injector) { LOGGER.debug("Checking Database Connectivity"); final Project project = injector.getOrThrow(ProjectComponent.class) .getProject(); project.dbmses().forEachOrdered(dbms -> { final DbmsHandlerComponent dbmsHandlerComponent = injector .getOrThrow(DbmsHandlerComponent.class); final DbmsType dbmsType = DatabaseUtil .dbmsTypeOf(dbmsHandlerComponent, dbms); final DbmsMetadataHandler handler = dbmsType.getMetadataHandler(); try { LOGGER.info(handler.getDbmsInfoString(dbms)); } catch (final SQLException sqle) { throw new SpeedmentException("Unable to establish initial " + "connection with the database named " + dbms.getName() + ".", sqle); } }); }
LOGGER.info("Creating Temporary Speedment..."); .withComponent(SingleColumnSqlAdapter.class) .beforeInitialized(PasswordComponent.class, passw -> { LOGGER.info("Installing Password..."); passw.put(dbmsName, password); }) .build(); LOGGER.info("Temporary Speedment built. Streaming..."); .collect(joining(",")); LOGGER.info("Streaming complete!");
private CompletableFuture<Project> readSchemaMetadata( Project project, Dbms dbms, ProgressMeasure progress) { //final DbmsType dbmsType = dbmsTypeOf(dbmsHandlerComponent, dbms); progress.setCurrentAction(describe(dbms)); LOGGER.info(describe(dbms)); final CompletableFuture<Map<String, Class<?>>> typeMappingTask = typeMappingHelper.loadFor(dbms); final Schema schema = dbms.mutator().addNewSchema(); schema.mutator().setId("schema"); schema.mutator().setName("schema"); return readTableMetadata(schema, typeMappingTask, progress) .thenApplyAsync($ -> project); }
private String readSchemaName(ResultSet rs, DbmsType dbmsType) throws SQLException { final String schemaName = rs.getString(dbmsType.getResultSetTableSchema()); String catalogName = ""; try { // This column is not there for Oracle so handle it // gracefully.... catalogName = rs.getString("TABLE_CATALOG"); } catch (final SQLException ex) { LOGGER.info("TABLE_CATALOG not in result set."); } return Optional.ofNullable(schemaName).orElse(catalogName); }
private void printStreamSupplierOrder(StreamSupplierComponent ssc, int level) { LOGGER.info("%s%s (0x%08x) %s", indent(level), ssc.getClass().getSimpleName(), ssc.hashCode(), ssc.isImmutable() ? "mutable" : "immutable"); ssc.sourceStreamSupplierComponents() .forEachOrdered(child -> printStreamSupplierOrder(child, level + 1)); }