Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-15735 improve igniteConfiguration string representation #11291

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.io.Serializable;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.S;

/**
* Encryption configuration.
Expand Down Expand Up @@ -105,4 +106,9 @@ public EncryptionConfiguration setReencryptionBatchSize(int reencryptionBatchSiz

return this;
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(EncryptionConfiguration.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.apache.ignite.failure.FailureHandler;
import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
import org.apache.ignite.internal.processors.odbc.ClientListenerProcessor;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
Expand Down Expand Up @@ -327,6 +328,7 @@ public class IgniteConfiguration {
private String igniteWorkDir;

/** MBean server. */
@GridToStringExclude
private MBeanServer mbeanSrv;

/** Local node ID. */
Expand Down Expand Up @@ -3601,6 +3603,7 @@ public IgniteConfiguration setAsyncContinuationExecutor(Executor asyncContinuati

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(IgniteConfiguration.class, this);
return S.toString(IgniteConfiguration.class, this,
"mbeanSrvCls", mbeanSrv != null ? mbeanSrv.getClass().getName() : null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.io.Serializable;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.S;

/**
* This class allows defining system data region configuration with various parameters for Apache Ignite
Expand Down Expand Up @@ -90,4 +91,9 @@ public SystemDataRegionConfiguration setMaxSize(long maxSize) {

return this;
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(SystemDataRegionConfiguration.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.io.IOException;
import java.nio.channels.AsynchronousFileChannel;
import java.nio.file.OpenOption;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.internal.S;

/**
* File I/O factory which uses {@link AsynchronousFileChannel} based implementation of FileIO.
Expand All @@ -30,6 +32,7 @@ public class AsyncFileIOFactory implements FileIOFactory {
private static final long serialVersionUID = 0L;

/** Thread local channel future holder. */
@GridToStringExclude
private transient volatile ThreadLocal<AsyncFileIO.ChannelOpFuture> holder = initHolder();

/** {@inheritDoc} */
Expand All @@ -54,4 +57,9 @@ private ThreadLocal<AsyncFileIO.ChannelOpFuture> initHolder() {
}
};
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(AsyncFileIOFactory.class, this, "holder", holder.get());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.io.IOException;
import java.nio.file.OpenOption;
import org.apache.ignite.internal.managers.encryption.EncryptionCacheKeyProvider;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.spi.encryption.EncryptionSpi;

/**
Expand Down Expand Up @@ -91,4 +92,9 @@ public class EncryptedFileIOFactory implements FileIOFactory {
void headerSize(int headerSize) {
this.headerSize = headerSize;
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(EncryptedFileIOFactory.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.OpenOption;
import org.apache.ignite.internal.util.typedef.internal.S;

/**
* File I/O factory which provides RandomAccessFileIO implementation of FileIO.
Expand All @@ -32,4 +33,9 @@ public class RandomAccessFileIOFactory implements FileIOFactory {
@Override public FileIO create(File file, OpenOption... modes) throws IOException {
return new RandomAccessFileIO(file, modes);
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(RandomAccessFileIOFactory.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.OpenOption;
import org.apache.ignite.internal.util.typedef.internal.S;

/**
* File I/O factory which provides {@link UnzipFileIO} implementation of FileIO.
Expand All @@ -32,4 +33,9 @@ public class UnzipFileIOFactory implements FileIOFactory {
@Override public UnzipFileIO create(File file, OpenOption... modes) throws IOException {
return new UnzipFileIO(file);
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(UnzipFileIOFactory.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.io.IOException;
import java.nio.file.OpenOption;
import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory;
import org.apache.ignite.internal.util.typedef.internal.S;

/**
* File I/O factory which provides {@link BufferedFileIO} implementation of FileIO.
Expand All @@ -41,4 +42,9 @@ public BufferedFileIOFactory(FileIOFactory factory) {
@Override public BufferedFileIO create(File file, OpenOption... modes) throws IOException {
return new BufferedFileIO(factory.create(file, modes));
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(BufferedFileIOFactory.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.nio.file.OpenOption;
import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.S;

import static org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.ZIP_SUFFIX;

Expand All @@ -45,4 +46,10 @@ public WriteOnlyZipFileIOFactory(FileIOFactory factory) {

return new WriteOnlyZipFileIO(factory.create(file, modes), entryName);
}


/** {@inheritDoc} */
@Override public String toString() {
return S.toString(WriteOnlyZipFileIOFactory.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.ignite.IgniteClientDisconnectedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.internal.util.GridSpinReadWriteLock;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.lang.IgniteFuture;

/**
Expand Down Expand Up @@ -106,4 +107,9 @@ public void stopped() {

lock.readUnlock();
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(ConnectGateway.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
import javax.crypto.spec.SecretKeySpec;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.spi.IgniteSpiAdapter;
Expand Down Expand Up @@ -113,6 +115,7 @@ public class KeystoreEncryptionSpi extends IgniteSpiAdapter implements Encryptio
private int keySize = DEFAULT_KEY_SIZE;

/** Master key. */
@GridToStringExclude
private volatile KeystoreEncryptionKey masterKey;

/** Master key name. */
Expand Down Expand Up @@ -526,4 +529,11 @@ private KeystoreEncryptionKey loadMasterKey(String masterKeyName) {
throw new IgniteSpiException(e);
}
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(KeystoreEncryptionSpi.class, this,
"keyStorePwd", keyStorePwd != null ? "*" : null,
"masterKey", masterKey != null ? "*" : null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.Serializable;
import java.nio.ByteBuffer;
import org.apache.ignite.IgniteException;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.spi.IgniteSpiAdapter;
import org.apache.ignite.spi.IgniteSpiException;
import org.apache.ignite.spi.IgniteSpiNoop;
Expand Down Expand Up @@ -124,4 +125,9 @@ public class NoopEncryptionSpi extends IgniteSpiAdapter implements EncryptionSpi
@Override public void spiStop() throws IgniteSpiException {
// No-op.
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(NoopEncryptionSpi.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Collection;
import java.util.Collections;
import org.apache.ignite.events.Event;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.spi.IgniteSpiAdapter;
import org.apache.ignite.spi.IgniteSpiException;
Expand Down Expand Up @@ -50,4 +51,9 @@ public class NoopEventStorageSpi extends IgniteSpiAdapter implements EventStorag
@Override public void spiStop() throws IgniteSpiException {
// No-op.
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(NoopEventStorageSpi.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Collection;
import java.util.Iterator;
import javax.cache.Cache;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.spi.IgniteSpiAdapter;
import org.apache.ignite.spi.IgniteSpiException;
import org.apache.ignite.spi.IgniteSpiNoop;
Expand Down Expand Up @@ -65,4 +66,9 @@ public class NoopIndexingSpi extends IgniteSpiAdapter implements IndexingSpi {

return this;
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(NoopIndexingSpi.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.ignite.spi.tracing;

import org.apache.ignite.internal.tracing.TracingSpiType;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.spi.IgniteSpiAdapter;
import org.apache.ignite.spi.IgniteSpiConsistencyChecked;
import org.apache.ignite.spi.IgniteSpiException;
Expand Down Expand Up @@ -67,4 +68,9 @@ public class NoopTracingSpi extends IgniteSpiAdapter implements TracingSpi<NoopS
@Override public byte type() {
return TracingSpiType.NOOP_TRACING_SPI.index();
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(NoopTracingSpi.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.configuration.DataStorageConfiguration;
import org.apache.ignite.internal.util.GridUnsafe;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -165,4 +166,9 @@ boolean isDirectIoAvailable() {
ConcurrentHashMap<Long, Thread> managedAlignedBuffers() {
return managedAlignedBuffers;
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(AlignedBuffersDirectFileIOFactory.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import io.opencensus.trace.export.SpanExporter;
import io.opencensus.trace.samplers.Samplers;
import org.apache.ignite.internal.tracing.TracingSpiType;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.spi.IgniteSpiAdapter;
import org.apache.ignite.spi.IgniteSpiConsistencyChecked;
import org.apache.ignite.spi.IgniteSpiException;
Expand Down Expand Up @@ -54,6 +56,7 @@
@IgniteSpiConsistencyChecked(optional = true)
public class OpenCensusTracingSpi extends IgniteSpiAdapter implements TracingSpi<OpenCensusSpanAdapter> {
/** Configured exporters. */
@GridToStringInclude
private final List<OpenCensusTraceExporter> exporters;

/** Flag indicates that external Tracing is used in environment. In this case no exporters will be started. */
Expand Down Expand Up @@ -151,4 +154,9 @@ public OpenCensusTracingSpi(SpanExporter.Handler... exporters) {
@Override public byte type() {
return TracingSpiType.OPEN_CENSUS_TRACING_SPI.index();
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(OpenCensusTracingSpi.class, this);
}
}