Package org.rhq.server.metrics.migrator.datasources

Examples of org.rhq.server.metrics.migrator.datasources.ExistingDataBulkExportSource


        BasicConfigurator.configure();
        Logger.getRootLogger().setLevel(Level.INFO);
        Logger.getLogger("org.rhq").setLevel(Level.DEBUG);
        EntityManagerFactory entityManagerFactory = null;
        EntityManager entityManager = null;
        ExistingDataBulkExportSource source = null;
        try {
            entityManagerFactory = createEntityManager();
            entityManager = entityManagerFactory.createEntityManager();
            source = new ExistingPostgresDataBulkExportSource(entityManager,
                "SELECT  schedule_id, time_stamp, value, minvalue, maxvalue FROM RHQ_MEASUREMENT_DATA_NUM_1D");
            StopWatch stopWatch = new StopWatch();
            stopWatch.start();
            source.initialize();
            int rowIndex = 0;
            int maxResults = 30000;
            for (;;) {
                List<Object[]> existingData = source.getData(rowIndex, maxResults);
                if (existingData.size() < maxResults) {
                    break;
                } else {
                    rowIndex += maxResults;
                }
            }
            stopWatch.stop();
            System.out.println("Execution: " + stopWatch);
        } finally {
            if (source != null) {
                source.close();
            }
            if (entityManager != null) {
                entityManager.close();
            }
            if (entityManagerFactory != null) {
View Full Code Here


        BasicConfigurator.configure();
        Logger.getRootLogger().setLevel(Level.INFO);
        Logger.getLogger("org.rhq").setLevel(Level.DEBUG);
        EntityManagerFactory entityManagerFactory = null;
        EntityManager entityManager = null;
        ExistingDataBulkExportSource source = null;
        try {
            entityManagerFactory = createEntityManager();
            entityManager = entityManagerFactory.createEntityManager();
            source = new ExistingPostgresDataBulkExportSource(entityManager,
                "SELECT  schedule_id, time_stamp, value, minvalue, maxvalue FROM RHQ_MEASUREMENT_DATA_NUM_1D");
            StopWatch stopWatch = new StopWatch();
            stopWatch.start();
            source.initialize();
            int rowIndex = 0;
            int maxResults = 30000;
            for (;;) {
                List<Object[]> existingData = source.getData(rowIndex, maxResults);
                if (existingData.size() < maxResults) {
                    break;
                } else {
                    rowIndex += maxResults;
                }
            }
            stopWatch.stop();
            System.out.println("Execution: " + stopWatch);
        } finally {
            if (source != null) {
                source.close();
            }
            if (entityManager != null) {
                entityManager.close();
            }
            if (entityManagerFactory != null) {
View Full Code Here

TOP

Related Classes of org.rhq.server.metrics.migrator.datasources.ExistingDataBulkExportSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.