Package com.persistit

Examples of com.persistit.Management$RecoveryInfo


            if (_refreshing)
                return;
            _refreshing = true;
        }
        try {
            final Management management = _adminUI.getManagement();
            if (reset) {
                _bufferPoolIndex = -1;
                _selectedExcludeMask = null;
                _selectedIncludeMask = null;
                _selectedTraversalType = 0;
                if (_toggleList != null) {
                    for (int index = 0; index < _toggleList.size(); index++) {
                        final JToggleButton toggle = (JToggleButton) _toggleList.get(index);
                        toggle.setSelected(false);
                    }
                }
                // if (_modeCombo != null)
                // {
                // _modeCombo.setSelectedIndex(0);
                // }
            }

            final Management.BufferPoolInfo[] bufferPoolInfoArray = management == null ? null : management
                    .getBufferPoolInfoArray();

            _bufferPoolInfoArrayModel.setInfoArray(bufferPoolInfoArray);

            if (_bufferPoolIndex < 0)
                _bufferPoolIndex = 0;
            if (_bufferPoolIndex >= 0 && bufferPoolInfoArray != null && _bufferPoolIndex < bufferPoolInfoArray.length) {
                final int bufferSize = bufferPoolInfoArray[_bufferPoolIndex].getBufferSize();
                _bufferInfoArrayModel.setInfoArray(management.getBufferInfoArray(bufferSize, _selectedTraversalType,
                        _selectedIncludeMask, _selectedExcludeMask));

                _poolDetailBorder.setTitle(MessageFormat.format(_poolDetailBorderPattern,
                        new Object[] { _adminUI.formatInteger(bufferSize) }));
                _poolDetailPanel.repaint(0, 0, 1000, 30);
View Full Code Here


            if (_refreshing)
                return;
            _refreshing = true;
        }
        try {
            final Management management = _adminUI.getManagement();
            if (reset) {
                _selectedTreeName = null;
                _selectedVolumeName = null;
                _logicalRecordArrayModel.setInfoArray(null);
            }

            Management.VolumeInfo[] volumeInfoArray = null;
            if (management != null) {
                volumeInfoArray = management.getVolumeInfoArray();
            }
            _volumeInfoArrayModel.setInfoArray(volumeInfoArray);

            Management.TreeInfo[] treeInfoArray = null;
            if (management != null && _selectedVolumeName != null) {
                treeInfoArray = management.getTreeInfoArray(_selectedVolumeName);
            }
            _treeInfoArrayModel.setInfoArray(treeInfoArray);
            if (_selectedTreeName != null) {
                for (int index = 0; index < treeInfoArray.length; index++) {
                    if (_selectedTreeName.equals(treeInfoArray[index].getName())) {
View Full Code Here

        _adminUI.scheduleRefresh(-1);
    }

    @Override
    public void actionPerformed(final AdminAction action, final ActionEvent ae) {
        final Management management = _adminUI.getManagement();
        if (management == null)
            return;
        try {
            final String name = action.getName();
            final boolean suspend = "SUSPEND_TASKS".equals(name);
            final boolean resume = "RESUME_TASKS".equals(name);
            final boolean stop = "STOP_TASKS".equals(name);
            final boolean remove = "REMOVE_TASKS".equals(name);

            if (suspend || resume || stop || remove) {
                final int[] selectedRows = _taskTable.getSelectedRows();
                final TaskStatus[] tsArray = new TaskStatus[selectedRows.length];
                for (int index = 0; index < tsArray.length; index++) {
                    final int row = selectedRows[index];
                    final TaskStatus ts = (TaskStatus) _taskStatusArrayModel.getValueAt(row, -1);
                    tsArray[index] = ts;
                }
                for (int index = 0; index < tsArray.length; index++) {
                    final TaskStatus ts = tsArray[index];
                    final long taskId = ts.getTaskId();
                    if (suspend || resume) {
                        management.setTaskSuspended(taskId, suspend);
                    } else if (stop || remove) {
                        management.stopTask(taskId, remove);
                    }
                }
            }
            _adminUI.scheduleRefresh(-1);
        } catch (final Exception e) {
View Full Code Here

        updateDetailedTaskStatus();
        return false;
    }

    private void updateDetailedTaskStatus() {
        final Management management = _adminUI.getManagement();

        if (_selectedTaskId == -1 || management == null) {
            updateDetailedTaskStatus(null);
        } else {
            try {
                final TaskStatus[] array = management.queryTaskStatus(_selectedTaskId, true, false, false);
                if (array.length == 1) {
                    updateDetailedTaskStatus(array[0]);
                }
            } catch (final RemoteException re) {
                _adminUI.postException(re);
View Full Code Here

            _refreshing = true;
        }
        try {
            boolean liveTasks = false;
            boolean stillSelected = false;
            final Management management = _adminUI.getManagement();
            if (management != null) {
                final TaskStatus[] taskStatusArray = management.queryTaskStatus(-1, false, false, false);
                _taskStatusArrayModel.setInfoArray(taskStatusArray);
                setTaskActionEnabledState(_taskTable.getSelectedRowCount() > 0);
                for (int index = 0; index < taskStatusArray.length; index++) {
                    final TaskStatus ts = taskStatusArray[index];
                    if (ts.getState() < Task.STATE_DONE)
View Full Code Here

        add(splitPane, BorderLayout.CENTER);
    }

    @Override
    protected void refreshed() {
        final Management management = _adminUI.getManagement();
        final Management.LogicalRecord lr = _host.getLogicalRecord();
        if (management == null || lr == null) {
            nullMessage();
        } else if (_host.isShowValue()) {
            final ValueState valueState = lr.getValueState();
            try {
                final Object[] results = management.decodeValueObjects(valueState, null);
                final ValueInspectorTreeNode root = new ValueInspectorTreeNode(null, results, "Value", Object[].class);
                _treeModel.setRoot(root);
                _textArea.setText(null);

            } catch (final Exception e) {
                _host.setLogicalRecord(null);
                _adminUI.postException(e);
            }
        } else {
            final KeyState keyState = lr.getKeyState();
            try {
                final Object[] results = management.decodeKeyObjects(keyState, null);

                final ValueInspectorTreeNode root = new ValueInspectorTreeNode(null, results, "KeySegments",
                        Object[].class);
                _treeModel.setRoot(root);
            } catch (final Exception e) {
View Full Code Here

            if (_refreshing)
                return;
            _refreshing = true;
        }
        try {
            final Management management = _adminUI.getManagement();
            if (reset) {
                _selectedVolumeName = null;
            }

            VolumeInfo[] volumeInfoArray = null;
            if (management != null) {
                volumeInfoArray = management.getVolumeInfoArray();
            }
            _volumeInfoArrayModel.setInfoArray(volumeInfoArray);

            TreeInfo[] treeInfoArray = null;
            if (management != null && _selectedVolumeName != null) {
                treeInfoArray = management.getTreeInfoArray(_selectedVolumeName);
            }
            updateTreeListModel(_selectedVolumeName, treeInfoArray);
        } catch (final RemoteException re) {
            _adminUI.postException(re);
        } finally {
View Full Code Here

        } else if ("ADD_ALL_ALL".equals(name)) {
            _volumeList.clearSelection();
            _treeListModel.clear();
            _selectedTreeListModel.clear();
            final int volumeCount = _volumeList.getModel().getSize();
            final Management management = _adminUI.getManagement();
            if (management != null) {
                for (int volumeIndex = 0; volumeIndex < volumeCount; volumeIndex++) {
                    final VolumeInfo volumeInfo = (VolumeInfo) _volumeList.getModel().getElementAt(volumeIndex);
                    final String volumeName = volumeInfo.getName();
                    try {
                        final TreeInfo[] treeInfoArray = management.getTreeInfoArray(volumeName);

                        for (int treeIndex = 0; treeIndex < treeInfoArray.length; treeIndex++) {
                            final TreeItem item = new TreeItem();
                            item._volumeName = volumeName;
                            item._treeName = treeInfoArray[treeIndex].getName();
View Full Code Here

    }

    @Override
    protected void refresh(final boolean reset) {
        try {
            final Management management = _adminUI.getManagement();
            if (management == null) {
                _version.setText("");
                _copyright.setText("");
                _started.setText("");
                _elapsed.setText("");

                _totalReads.setText("");
                _totalWrites.setText("");
                _totalGets.setText("");
                _hitRatio.setText("");

                _commits.setText("");
                _rollbacks.setText("");
                _rollbacksSinceLastCommit.setText("");

                _journalCurLocation.setText("");
                _journalBlockSize.setText("");

                _journalBaseAddress.setText("");
                _journalPageMapSize.setText("");
                _journalPageCount.setText("");
                _journalCopiedPageCount.setText("");
                _journalReadPageCount.setText("");

                _journalValidCkptTime.setText("");
                _journalValidCkptAgo.setText("");
                _journalValidCkptTimestamp.setText("");
                _journalValidCkptLocation.setText("");

                _journalAppendOnly.setText("");
                _journalCopyFast.setText("");

                _recoveryApplied.setText("");
                _recoveryBaseAddress.setText("");
                _recoveryCkptLocation.setText("");
                _recoveryCkptTime.setText("");
                _recoveryCkptTimestamp.setText("");
                _recoveryCommitted.setText("");
                _recoveryEndAddress.setText("");
                _recoveryException.setText("");
                _recoveryKeystone.setText("");
                _recoveryUncommitted.setText("");

                _volumeInfoArrayModel.setInfoArray(null);

            } else {
                _version.setText(management.getVersion());
                _copyright.setText(management.getCopyright());

                _started.setText(_adminUI.formatDate(management.getStartTime()));

                _elapsed.setText(_adminUI.formatTime(management.getElapsedTime()));

                _frozenUpdates.setText(management.isUpdateSuspended() ? _frozenTrueCaption : _frozenFalseCaption);

                _frozenUpdates.setForeground(management.isUpdateSuspended() ? Color.red : _normalForegroundColor);

                _frozenShutdown.setText(management.isShutdownSuspended() ? _frozenTrueCaption : _frozenFalseCaption);

                _frozenShutdown.setForeground(management.isShutdownSuspended() ? Color.red : _normalForegroundColor);

                final Management.JournalInfo jinfo = management.getJournalInfo();
                _journalCurLocation.setText(_adminUI.formatFileLocation(jinfo.getCurrentJournalFile(),
                        jinfo.getCurrentJournalAddress()));
                _journalBlockSize.setText(_adminUI.formatLong(jinfo.getBlockSize()));

                _journalBaseAddress.setText(_adminUI.formatLong(jinfo.getBaseAddress()));

                _journalPageMapSize.setText(_adminUI.formatLong(jinfo.getPageMapSize()));
                _journalPageCount.setText(_adminUI.formatLong(jinfo.getJournaledPageCount()));
                _journalCopiedPageCount.setText(_adminUI.formatLong(jinfo.getCopiedPageCount()));
                _journalReadPageCount.setText(_adminUI.formatLong(jinfo.getReadPageCount()));

                if (jinfo.getLastValidCheckpointSystemTime() != 0) {
                    _journalValidCkptTime.setText(_adminUI.formatDate(jinfo.getLastValidCheckpointSystemTime()));
                    _journalValidCkptAgo.setText(_adminUI.formatLong(jinfo.getLastValidCheckpointAge()));
                    _journalValidCkptTimestamp.setText(_adminUI.formatLong(jinfo.getLastValidCheckpointTimestamp()));
                    _journalValidCkptLocation.setText(_adminUI.formatFileLocation(
                            jinfo.getLastValidCheckpointJournalFile(), jinfo.getLastValidCheckpointJournalAddress()));
                }

                _journalAppendOnly.setText(jinfo.isAppendOnly() ? _enabledCaption : _disabledCaption);

                _journalCopyFast.setText(jinfo.isFastCopying() ? _enabledCaption : _disabledCaption);

                final Management.RecoveryInfo rinfo = management.getRecoveryInfo();

                _recoveryApplied.setText(_adminUI.formatInteger(rinfo.getAppliedTransactions()));
                _recoveryBaseAddress.setText(_adminUI.formatLong(rinfo.getBaseAddress()));
                _recoveryCkptLocation.setText(_adminUI.formatLong(rinfo.getLastValidCheckpointJournalAddress()));
                _recoveryCkptTime.setText(_adminUI.formatDate(rinfo.getLastValidCheckpointSystemTime()));
                _recoveryCkptTimestamp.setText(_adminUI.formatLong(rinfo.getLastValidCheckpointTimestamp()));
                _recoveryCommitted.setText(_adminUI.formatInteger(rinfo.getCommittedTransactions()));
                _recoveryEndAddress.setText(_adminUI.formatLong(rinfo.getRecoveryEndAddress()));
                _recoveryException.setText(rinfo.getRecoveryEndedException() == null ? "none" : rinfo
                        .getRecoveryEndedException());
                _recoveryKeystone.setText(_adminUI.formatFileLocation(rinfo.getKeystoneJournalFile(),
                        rinfo.getKeystoneJournalAddress()));
                _recoveryUncommitted.setText(_adminUI.formatInteger(rinfo.getUncommittedTransactions()));

                final Management.BufferPoolInfo[] bpia = management.getBufferPoolInfoArray();

                long reads = 0;
                long writes = 0;
                long misses = 0;
                long hits = 0;
                long creates = 0;

                for (int index = 0; index < bpia.length; index++) {
                    misses += bpia[index].getMissCount();
                    hits += bpia[index].getHitCount();
                    creates += bpia[index].getNewCount();
                }

                final Management.VolumeInfo[] via = management.getVolumeInfoArray();

                if (_selectedVolumeName == null && via.length > 0) {
                    _selectedVolumeName = via[0].getName();
                }

                for (int index = 0; index < via.length; index++) {
                    reads += via[index].getReadCounter();
                    writes += via[index].getWriteCounter();
                }

                _totalReads.setText(_adminUI.formatLong(reads));
                _totalWrites.setText(_adminUI.formatLong(writes));
                _totalGets.setText(_adminUI.formatLong(misses));
                _hitRatio.setText(misses + hits + creates > 0 ? _adminUI.formatPercent((double) hits
                        / (double) (misses + hits + creates)) : "n/a");
                _volumeInfoArrayModel.setInfoArray(via);

                final Management.TransactionInfo transactionInfo = management.getTransactionInfo();
                _commits.setText(_adminUI.formatLong(transactionInfo.getCommitCount()));
                _rollbacks.setText(_adminUI.formatLong(transactionInfo.getRollbackCount()));
                _rollbacksSinceLastCommit.setText(_adminUI.formatLong(transactionInfo.getRollbackSinceCommitCount()));

            }
View Full Code Here

            _logicalRecord = lr;
        }

        @Override
        public void run() {
            final Management management = _adminUI.getManagement();
            if (management == null)
                return;
            try {
                final Management.LogicalRecord[] results = management.getLogicalRecordArray(getVolumeName(),
                        getTreeName(), null, _logicalRecord.getKeyState(), Key.EQ, 1, Integer.MAX_VALUE, true

                );
                if (results == null || results.length == 0) {
                    _logicalRecord = null;
View Full Code Here

TOP

Related Classes of com.persistit.Management$RecoveryInfo

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.