| | |
| | | boolean profileMode,
|
| | | boolean useTransform) {
|
| | | return new OracleConvertEdbGeoJobContext(getDataPath(),
|
| | | getTargetDataStore(), targetSchemaName, filterPath, profileMode, useTransform);
|
| | | getTargetDataStore(), targetSchemaName, filterPath, profileMode, useTransform);
|
| | | }
|
| | |
|
| | | protected void extractJobConfiguration(JobDetail jobDetail) throws JobExecutionException {
|
| | |
| | |
|
| | | OracleConvertEdbGeoJobContext jobContext =
|
| | | (OracleConvertEdbGeoJobContext) prepareJobContext(targetSchemaName, _filterPath,
|
| | | isProfileMode(), isTransformed());
|
| | | isProfileMode(), isTransformed());
|
| | | jobContext.setSourceDataStore(getSourceDataStore());
|
| | | // jobContext.setConvertElementIn(_convertElementIn);
|
| | | jobContext.setElementLogging(checkElementLogging());
|
| | | jobContext.setExecutionContext(context);
|
| | |
|
| | | createHibernateSequence(jobContext);
|
| | | fetchTPData(jobContext);
|
| | | logger.info("TPC DIST:" + jobContext.getDistId() + ":" +
|
| | | ((jobContext.getDistName() == null) ? "NULL" : jobContext.getDistName()));
|
| | |
|
| | | long tStep = System.currentTimeMillis();
|
| | |
|
| | | if (isCopyConnectivityMode())
|
| | | {
|
| | | if (isCopyConnectivityMode()) {
|
| | | copyConnectivity(jobContext);
|
| | | }
|
| | |
|
| | |
| | | (((int) ((tCurrent - tBefore) % 60000.0)) / 1000) + " sec");
|
| | | }
|
| | |
|
| | | /**
|
| | | * Connectivity�ƻs�@�Ӫ����A�b�d�߹q�y��V�ɥΨӤ��OMS��Ʈw���q���s����(Connectivity)
|
| | | *
|
| | | * @param jobContext job context
|
| | | * @throws SQLException sql exception
|
| | | */
|
| | | private void copyConnectivity(OracleConvertEdbGeoJobContext jobContext) throws SQLException {
|
| | | Connection connection = jobContext.getOracleConnection();
|
| | | ResultSet rsMeta = connection.getMetaData().getTables(null, "BASEDB",
|
| | | AbstractOracleJobContext.CONNECTIVITY_WEBCHECK_NAME + "%",
|
| | | new String[]{"TABLE"});
|
| | |
|
| | | boolean found = false;
|
| | | try {
|
| | | while (rsMeta.next()) {
|
| | | String tablename = rsMeta.getString(3);
|
| | | if (AbstractOracleJobContext.CONNECTIVITY_WEBCHECK_NAME.equalsIgnoreCase(tablename)) {
|
| | | found = true;
|
| | | break;
|
| | | }
|
| | | }
|
| | | // } catch (SQLException e)
|
| | | } finally {
|
| | | if (rsMeta != null) {
|
| | | rsMeta.close();
|
| | | rsMeta = null;
|
| | | }
|
| | | }
|
| | | Statement stmt = connection.createStatement();
|
| | | if (found) {
|
| | | stmt.execute(AbstractOracleJobContext.TRUNCATE_CONNECTIVITY_WEBCHECK);
|
| | | } else {
|
| | | logger.info("Create CONNECTIVITY_WEBCHECK table.");
|
| | | stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK);
|
| | | stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_1);
|
| | | stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_2);
|
| | | stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_3);
|
| | | stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_4);
|
| | | stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_5);
|
| | | stmt.execute(AbstractOracleJobContext.CREATE_CONNECTIVITY_WEBCHECK_INDEX_6);
|
| | | stmt.execute(AbstractOracleJobContext.ALTER_CONNECTIVITY_WEBCHECK_1);
|
| | | stmt.execute(AbstractOracleJobContext.ALTER_CONNECTIVITY_WEBCHECK_2);
|
| | | }
|
| | |
|
| | | stmt.execute(AbstractOracleJobContext.COPY_CONNECTIVITY_TO_WEBCHECK);
|
| | | stmt.close();
|
| | | }
|
| | |
|
| | |
|
| | | private void createHibernateSequence(OracleConvertEdbGeoJobContext jobContext) throws SQLException {
|
| | | Connection connection = jobContext.getOracleConnection();
|
| | |
|
| | | try {
|
| | | Statement stmt = connection.createStatement();
|
| | | stmt.execute(AbstractOracleJobContext.CREATE_HIBERNATE_SEQUENCE);
|
| | | stmt.close();
|
| | | } catch (SQLException e)
|
| | | {
|
| | | logger.warn("HIBERNATE_SEQUENCE is already exist.");
|
| | | }
|
| | | }
|
| | |
|
| | | private void exetcuteConvert(OracleConvertEdbGeoJobContext jobContext,
|
| | | String querySchema, String targetSchemaName) throws SQLException {
|
| | | int order = 0;
|
| | | OrderedMap map = getBlobStorageList(jobContext.getOracleConnection(),
|
| | | querySchema, "SD$SPACENODES", null);
|
| | | querySchema, "SD$SPACENODES", null);
|
| | |
|
| | | logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode);
|
| | |
|
| | |
| | | int step = total / 100;
|
| | | int current = 0;
|
| | |
|
| | | if (total == 0) {
|
| | | if (total == 0) {
|
| | | logger.warn("SELECT COUNT FROM " + querySchema + ".SD$SPACENODES is zero.");
|
| | | return;
|
| | | }
|
| | | logger.warn("SELECT COUNT FROM " + querySchema + ".SD$SPACENODES is " + map.size() );
|
| | | logger.warn("SELECT COUNT FROM " + querySchema + ".SD$SPACENODES is " + map.size());
|
| | |
|
| | | //jobContext.startTransaction();
|
| | | jobContext.setCurrentSchema(querySchema);
|
| | | jobContext.getExecutionContext().put("ConvertDgn2EdbGeoJobProgress", 0);
|
| | | for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) {
|
| | | for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext(); ) {
|
| | | it.next();
|
| | |
|
| | | Pair pair = (Pair) it.getValue();
|
| | |
| | | System.runFinalization();
|
| | | }
|
| | |
|
| | | if( step != 0)
|
| | | {
|
| | | if (step != 0) {
|
| | | int now = order % step;
|
| | | if (now != current) {
|
| | | current = now;
|
| | | jobContext.getExecutionContext().put("ConvertDgn2EdbGeoSpatialJob", current);
|
| | |
|
| | | }
|
| | | }else
|
| | | {
|
| | | } else {
|
| | | jobContext.getExecutionContext().put("ConvertDgn2EdbGeoSpatialJob", current);
|
| | | current++;
|
| | | }
|
| | |
| | | if (dgnFile.isDirectory()) continue;
|
| | | IndexDgnConvertEdbGeoJobContext convertContext =
|
| | | new IndexDgnConvertEdbGeoJobContext(getDataPath(), getTargetDataStore(), targetSchemaName,
|
| | | isProfileMode(), isTransformed());
|
| | | isProfileMode(), isTransformed());
|
| | | logger.info("--- start index dgnfile-" + dgnFile.toString() + " ---");
|
| | | FileInputStream fs = null;
|
| | | FileChannel fc = null;
|
| | |
| | | } finally {
|
| | | convertContext.closeFeatureWriter();
|
| | |
|
| | | if (reader != null)
|
| | | {
|
| | | if (reader != null) {
|
| | | try {
|
| | | reader.close();
|
| | | } catch (IOException e) {
|
| | |
| | | // }
|
| | | //} else {
|
| | | // if (element instanceof ShapeElement) {
|
| | | convertContext.putFeatureCollection(element);
|
| | | convertContext.putFeatureCollection(element);
|
| | | // }
|
| | | //}
|
| | | }
|
| | |
| | |
|
| | | GeneralDgnConvertEdbGeoJobContext convertContext =
|
| | | new GeneralDgnConvertEdbGeoJobContext(getDataPath(), getTargetDataStore(), targetSchemaName,
|
| | | isProfileMode(), isTransformed());
|
| | | isProfileMode(), isTransformed());
|
| | | logger.info("--- start other dgnfile-" + dgnFile.toString() + " ---");
|
| | | FileInputStream fs = null;
|
| | | FileChannel fc;
|
| | |
| | | } finally {
|
| | | convertContext.closeFeatureWriter();
|
| | |
|
| | | if (reader != null)
|
| | | {
|
| | | if (reader != null) {
|
| | | try {
|
| | | reader.close();
|
| | | } catch (IOException e) {
|
| | |
| | | for (File dgnFile : dgnFiles) {
|
| | | FeatureDgnConvertEdbGeoJobContext convertContext =
|
| | | new FeatureDgnConvertEdbGeoJobContext(getDataPath(), getTargetDataStore(), targetSchemaName, _filterPath,
|
| | | isProfileMode(), isTransformed());
|
| | | isProfileMode(), isTransformed());
|
| | | logger.info("--- start dgnfile-" + dgnFile.toString() + " ---");
|
| | | try {
|
| | | convertContext.setExecutionContext(context);
|