Package com.persistit

Examples of com.persistit.Management


    }

    @Override
    protected void refresh(boolean reset) {
        try {
            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();
                }

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

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

                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);

                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


            if (_refreshing)
                return;
            _refreshing = true;
        }
        try {
            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++) {
                        JToggleButton toggle = (JToggleButton) _toggleList.get(index);
                        toggle.setSelected(false);
                    }
                }
                // if (_modeCombo != null)
                // {
                // _modeCombo.setSelectedIndex(0);
                // }
            }

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

            _bufferPoolInfoArrayModel.setInfoArray(bufferPoolInfoArray);

            if (_bufferPoolIndex < 0)
                _bufferPoolIndex = 0;
            if (_bufferPoolIndex >= 0 && bufferPoolInfoArray != null && _bufferPoolIndex < bufferPoolInfoArray.length) {
                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 {
            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

        add(splitPane, BorderLayout.CENTER);
    }

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

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

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

        _adminUI.scheduleRefresh(-1);
    }

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

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

        updateDetailedTaskStatus();
        return false;
    }

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

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

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

            Management.LogicalRecord rec = null;
            if (_from != -1) {
                rec = (Management.LogicalRecord) _infoArray[_from - _offset];
            }
            KeyState ks = rec == null ? KeyState.LEFT_GUARD_KEYSTATE : rec.getKeyState();
            Management management = _adminUI.getManagement();
            _resultRows = new Management.LogicalRecord[0];
            if (management != null) {
                try {
                    if (_skipCount > 0) {
                        LogicalRecordCount lrc = management.getLogicalRecordCount(_volumeName, _treeName,
                                _keyFilterString, ks, _forward ? Key.GT : Key.LT, _skipCount);
                        int skipped = lrc.getCount();
                        if (skipped > 0) {
                            ks = lrc.getKeyState();
                            _from = _forward ? _from + skipped : _from - skipped;
                        }
                    }

                    _resultRows = management.getLogicalRecordArray(_volumeName, _treeName, _keyFilterString, ks,
                            _forward ? Key.GT : Key.LT, _requestedCount, _maxValueSize, true);
                } catch (RemoteException remoteException) {
                    // TODO
                    _exception = remoteException;
                }
View Full Code Here

            if (_refreshing)
                return;
            _refreshing = true;
        }
        try {
            Management management = _management;
            if (management != null) {
                try {
                    management.isInitialized();
                } catch (RemoteException re) {
                    disconnect();
                    management = null;
                }
            }
View Full Code Here

    public Management getManagement() {
        return _management;
    }

    public void setManagement(Management newManagement) {
        Management oldManagement = _management;
        if (oldManagement != null) {
            unfreeze(oldManagement);
        }
        _management = newManagement;
        SwingUtilities.invokeLater(this);
View Full Code Here

TOP

Related Classes of com.persistit.Management

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.