ignite-2.1.1 Fixed Visor snapshots screen.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/17997287 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/17997287 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/17997287 Branch: refs/heads/ignite-5267-1 Commit: 179972871d5e6c214046ae878e8811cd899baa67 Parents: 3d023f4 Author: Alexey Kuznetsov <[email protected]> Authored: Thu Jun 15 20:10:25 2017 +0700 Committer: Alexey Kuznetsov <[email protected]> Committed: Thu Jun 15 20:10:25 2017 +0700 ---------------------------------------------------------------------- .../apache/ignite/configuration/WALMode.java | 5 +- .../visor/node/VisorGridConfiguration.java | 17 +- .../node/VisorPersistentStoreConfiguration.java | 307 +++++++++++++++++++ .../resources/META-INF/classnames.properties | 1 + 4 files changed, 326 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/17997287/modules/core/src/main/java/org/apache/ignite/configuration/WALMode.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/WALMode.java b/modules/core/src/main/java/org/apache/ignite/configuration/WALMode.java index 4bf4b90..9d4520e 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/WALMode.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/WALMode.java @@ -54,8 +54,7 @@ public enum WALMode { * @param ord Ordinal value. * @return Enumerated value or {@code null} if ordinal out of range. */ - @Nullable - public static WALMode fromOrdinal(int ord) { + @Nullable public static WALMode fromOrdinal(int ord) { return ord >= 0 && ord < VALS.length ? VALS[ord] : null; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ignite/blob/17997287/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java index ef916dc..180a729 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java @@ -92,9 +92,12 @@ public class VisorGridConfiguration extends VisorDataTransferObject { /** Transactions configuration. */ private VisorTransactionConfiguration txCfg; - /** Database configuration. */ + /** Memory configuration. */ private VisorMemoryConfiguration memCfg; + /** Persistence configuration. */ + private VisorPersistentStoreConfiguration psCfg; + /** Cache store session listeners. */ private String storeSesLsnrs; @@ -153,6 +156,9 @@ public class VisorGridConfiguration extends VisorDataTransferObject { if (c.getMemoryConfiguration() != null) memCfg = new VisorMemoryConfiguration(c.getMemoryConfiguration()); + if (c.getPersistentStoreConfiguration() != null) + psCfg = new VisorPersistentStoreConfiguration(c.getPersistentStoreConfiguration()); + storeSesLsnrs = compactArray(c.getCacheStoreSessionListenerFactories()); warmupClos = compactClass(c.getWarmupClosure()); @@ -296,6 +302,13 @@ public class VisorGridConfiguration extends VisorDataTransferObject { } /** + * @return Persistent store configuration. + */ + public VisorPersistentStoreConfiguration getPersistentStoreConfiguration() { + return psCfg; + } + + /** * @return Cache store session listener factories. */ public String getCacheStoreSessionListenerFactories() { @@ -363,6 +376,7 @@ public class VisorGridConfiguration extends VisorDataTransferObject { out.writeObject(atomic); out.writeObject(txCfg); out.writeObject(memCfg); + out.writeObject(psCfg); U.writeString(out, storeSesLsnrs); U.writeString(out, warmupClos); out.writeObject(binaryCfg); @@ -391,6 +405,7 @@ public class VisorGridConfiguration extends VisorDataTransferObject { atomic = (VisorAtomicConfiguration)in.readObject(); txCfg = (VisorTransactionConfiguration)in.readObject(); memCfg = (VisorMemoryConfiguration)in.readObject(); + psCfg = (VisorPersistentStoreConfiguration)in.readObject(); storeSesLsnrs = U.readString(in); warmupClos = U.readString(in); binaryCfg = (VisorBinaryConfiguration)in.readObject(); http://git-wip-us.apache.org/repos/asf/ignite/blob/17997287/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistentStoreConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistentStoreConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistentStoreConfiguration.java new file mode 100644 index 0000000..3559845 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistentStoreConfiguration.java @@ -0,0 +1,307 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.ignite.internal.visor.node; + +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import org.apache.ignite.configuration.PersistentStoreConfiguration; +import org.apache.ignite.configuration.WALMode; +import org.apache.ignite.internal.util.typedef.internal.S; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.internal.visor.VisorDataTransferObject; + +/** + * DTO object for {@link PersistentStoreConfiguration}. + */ +public class VisorPersistentStoreConfiguration extends VisorDataTransferObject { + /** */ + private static final long serialVersionUID = 0L; + + /** */ + private String persistenceStorePath; + + /** Checkpointing frequency. */ + private long checkpointingFreq; + + /** Lock wait time. */ + private int lockWaitTime; + + /** */ + private Long checkpointingPageBufSize; + + /** */ + private int checkpointingThreads; + + /** */ + private int walHistSize; + + /** Number of work WAL segments. */ + private int walSegments; + + /** Number of WAL segments to keep. */ + private int walSegmentSize; + + /** WAL persistence path. */ + private String walStorePath; + + /** WAL archive path. */ + private String walArchivePath; + + /** Metrics enabled flag. */ + private boolean metricsEnabled; + + /** Wal mode. */ + private WALMode walMode; + + /** WAl thread local buffer size. */ + private int tlbSize; + + /** Wal flush frequency. */ + private int walFlushFreq; + + /** Wal fsync delay. */ + private int walFsyncDelay; + + /** Wal record iterator buffer size. */ + private int walRecordIterBuffSize; + + /** Always write full pages. */ + private boolean alwaysWriteFullPages; + + /** Number of sub-intervals. */ + private int subIntervals; + + /** Time interval (in milliseconds) for rate-based metrics. */ + private long rateTimeInterval; + + /** + * Default constructor. + */ + public VisorPersistentStoreConfiguration() { + // No-op. + } + + /** + * @param cfg Persistent store configuration. + */ + public VisorPersistentStoreConfiguration(PersistentStoreConfiguration cfg) { + persistenceStorePath = cfg.getPersistentStorePath(); + checkpointingFreq = cfg.getCheckpointingFrequency(); + lockWaitTime = cfg.getLockWaitTime(); + checkpointingPageBufSize = cfg.getCheckpointingPageBufferSize(); + checkpointingThreads = cfg.getCheckpointingThreads(); + walHistSize = cfg.getWalHistorySize(); + walSegments = cfg.getWalSegments(); + walSegmentSize = cfg.getWalSegmentSize(); + walStorePath = cfg.getWalStorePath(); + walArchivePath = cfg.getWalArchivePath(); + metricsEnabled = cfg.isMetricsEnabled(); + walMode = cfg.getWalMode(); + tlbSize = cfg.getTlbSize(); + walFlushFreq = cfg.getWalFlushFrequency(); + walFsyncDelay = cfg.getWalFsyncDelay(); + walRecordIterBuffSize = cfg.getWalRecordIteratorBufferSize(); + alwaysWriteFullPages = cfg.isAlwaysWriteFullPages(); + subIntervals = cfg.getSubIntervals(); + rateTimeInterval = cfg.getRateTimeInterval(); + } + + /** + * @return Path the root directory where the Persistent Store will persist data and indexes. + */ + public String getPersistentStorePath() { + return persistenceStorePath; + } + + /** + * @return Checkpointing frequency in milliseconds. + */ + public long getCheckpointingFrequency() { + return checkpointingFreq; + } + + /** + * @return Checkpointing page buffer size in bytes. + */ + public Long getCheckpointingPageBufferSize() { + return checkpointingPageBufSize; + } + + /** + * @return Number of checkpointing threads. + */ + public int getCheckpointingThreads() { + return checkpointingThreads; + } + + /** + * @return Time for wait. + */ + public int getLockWaitTime() { + return lockWaitTime; + } + + /** + * @return Number of WAL segments to keep after a checkpoint is finished. + */ + public int getWalHistorySize() { + return walHistSize; + } + + /** + * @return Number of work WAL segments. + */ + public int getWalSegments() { + return walSegments; + } + + /** + * @return WAL segment size. + */ + public int getWalSegmentSize() { + return walSegmentSize; + } + + /** + * @return WAL persistence path, absolute or relative to Ignite work directory. + */ + public String getWalStorePath() { + return walStorePath; + } + + /** + * @return WAL archive directory. + */ + public String getWalArchivePath() { + return walArchivePath; + } + + /** + * @return Metrics enabled flag. + */ + public boolean isMetricsEnabled() { + return metricsEnabled; + } + + /** + * @return Time interval in milliseconds. + */ + public long getRateTimeInterval() { + return rateTimeInterval; + } + + /** + * @return The number of sub-intervals for history tracking. + */ + public int getSubIntervals() { + return subIntervals; + } + + /** + * @return WAL mode. + */ + public WALMode getWalMode() { + return walMode; + } + + /** + * @return Thread local buffer size. + */ + public int getTlbSize() { + return tlbSize; + } + + /** + * @return Flush frequency. + */ + public int getWalFlushFrequency() { + return walFlushFreq; + } + + /** + * Gets the fsync delay, in nanoseconds. + */ + public int getWalFsyncDelay() { + return walFsyncDelay; + } + + /** + * @return Record iterator buffer size. + */ + public int getWalRecordIteratorBufferSize() { + return walRecordIterBuffSize; + } + + /** + * + */ + public boolean isAlwaysWriteFullPages() { + return alwaysWriteFullPages; + } + + /** {@inheritDoc} */ + @Override protected void writeExternalData(ObjectOutput out) throws IOException { + U.writeString(out, persistenceStorePath); + out.writeLong(checkpointingFreq); + out.writeInt(lockWaitTime); + out.writeObject(checkpointingPageBufSize); + out.writeInt(checkpointingThreads); + out.writeInt(walHistSize); + out.writeInt(walSegments); + out.writeInt(walSegmentSize); + U.writeString(out, walStorePath); + U.writeString(out, walArchivePath); + out.writeBoolean(metricsEnabled); + U.writeEnum(out, walMode); + out.writeInt(tlbSize); + out.writeInt(walFlushFreq); + out.writeInt(walFsyncDelay); + out.writeInt(walRecordIterBuffSize); + out.writeBoolean(alwaysWriteFullPages); + out.writeInt(subIntervals); + out.writeLong(rateTimeInterval); + } + + /** {@inheritDoc} */ + @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException { + persistenceStorePath = U.readString(in); + checkpointingFreq = in.readLong(); + lockWaitTime = in.readInt(); + checkpointingPageBufSize = (Long)in.readObject(); + checkpointingThreads = in.readInt(); + walHistSize = in.readInt(); + walSegments = in.readInt(); + walSegmentSize = in.readInt(); + walStorePath = U.readString(in); + walArchivePath = U.readString(in); + metricsEnabled = in.readBoolean(); + walMode = WALMode.fromOrdinal(in.readByte()); + tlbSize = in.readInt(); + walFlushFreq = in.readInt(); + walFsyncDelay = in.readInt(); + walRecordIterBuffSize = in.readInt(); + alwaysWriteFullPages = in.readBoolean(); + subIntervals = in.readInt(); + rateTimeInterval = in.readLong(); + } + + /** {@inheritDoc} */ + @Override public String toString() { + return S.toString(VisorPersistentStoreConfiguration.class, this); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/17997287/modules/core/src/main/resources/META-INF/classnames.properties ---------------------------------------------------------------------- diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties index 11691a4..93382d7 100644 --- a/modules/core/src/main/resources/META-INF/classnames.properties +++ b/modules/core/src/main/resources/META-INF/classnames.properties @@ -1891,6 +1891,7 @@ org.apache.ignite.internal.visor.node.VisorNodeSuppressedErrorsTask org.apache.ignite.internal.visor.node.VisorNodeSuppressedErrorsTask$VisorNodeSuppressedErrorsJob org.apache.ignite.internal.visor.node.VisorNodeSuppressedErrorsTaskArg org.apache.ignite.internal.visor.node.VisorPeerToPeerConfiguration +org.apache.ignite.internal.visor.node.VisorPersistentStoreConfiguration org.apache.ignite.internal.visor.node.VisorRestConfiguration org.apache.ignite.internal.visor.node.VisorSegmentationConfiguration org.apache.ignite.internal.visor.node.VisorServiceConfiguration
