use of org.apache.ignite.logger.NullLogger in project ignite by apache.
the class GridCacheUtilsSelfTest method binaryMarshaller.
/**
* @return Binary marshaller.
* @throws IgniteCheckedException if failed.
*/
private BinaryMarshaller binaryMarshaller() throws IgniteCheckedException {
IgniteConfiguration iCfg = new IgniteConfiguration();
BinaryConfiguration bCfg = new BinaryConfiguration();
iCfg.setBinaryConfiguration(bCfg);
BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg, new NullLogger());
BinaryMarshaller marsh = new BinaryMarshaller();
marsh.setContext(new MarshallerContextTestImpl(null));
IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);
return marsh;
}
use of org.apache.ignite.logger.NullLogger in project ignite by apache.
the class GridH2IndexBase method initDistributedJoinMessaging.
/**
* @param tbl Table.
*/
protected final void initDistributedJoinMessaging(GridH2Table tbl) {
final GridH2RowDescriptor desc = tbl.rowDescriptor();
if (desc != null && desc.context() != null) {
ctx = desc.context();
GridKernalContext ctx = desc.context().kernalContext();
log = ctx.log(getClass());
msgTopic = new IgniteBiTuple<>(GridTopic.TOPIC_QUERY, tbl.identifierString() + '.' + getName());
msgLsnr = new GridMessageListener() {
@Override
public void onMessage(UUID nodeId, Object msg, byte plc) {
GridSpinBusyLock l = desc.indexing().busyLock();
if (!l.enterBusy())
return;
try {
onMessage0(nodeId, msg);
} finally {
l.leaveBusy();
}
}
};
ctx.io().addMessageListener(msgTopic, msgLsnr);
} else {
msgTopic = null;
msgLsnr = null;
log = new NullLogger();
}
}
use of org.apache.ignite.logger.NullLogger in project ignite by apache.
the class IgniteWalConverter method main.
/**
* @param args Args.
*/
public static void main(String[] args) throws Exception {
if (args.length < 2)
throw new IllegalArgumentException("\nYou need to provide:\n" + "\t1. Size of pages, which was selected for file store (1024, 2048, 4096, etc).\n" + "\t2. Path to dir with wal files.\n" + "\t3. (Optional) Path to dir with archive wal files.");
PageIO.registerH2(H2InnerIO.VERSIONS, H2LeafIO.VERSIONS);
H2ExtrasInnerIO.register();
H2ExtrasLeafIO.register();
boolean printRecords = IgniteSystemProperties.getBoolean("PRINT_RECORDS", false);
boolean printStat = IgniteSystemProperties.getBoolean("PRINT_STAT", true);
final IgniteWalIteratorFactory factory = new IgniteWalIteratorFactory(new NullLogger(), Integer.parseInt(args[0]), null, null, false);
final File walWorkDirWithConsistentId = new File(args[1]);
final File[] workFiles = walWorkDirWithConsistentId.listFiles(FileWriteAheadLogManager.WAL_SEGMENT_FILE_FILTER);
if (workFiles == null)
throw new IllegalArgumentException("No .wal files in dir: " + args[1]);
@Nullable final WalStat stat = printStat ? new WalStat() : null;
try (WALIterator stIt = factory.iteratorWorkFiles(workFiles)) {
while (stIt.hasNextX()) {
IgniteBiTuple<WALPointer, WALRecord> next = stIt.nextX();
final WALPointer pointer = next.get1();
final WALRecord record = next.get2();
if (stat != null)
stat.registerRecord(record, pointer, true);
if (printRecords)
System.out.println("[W] " + record);
}
}
if (args.length >= 3) {
final File walArchiveDirWithConsistentId = new File(args[2]);
try (WALIterator stIt = factory.iteratorArchiveDirectory(walArchiveDirWithConsistentId)) {
while (stIt.hasNextX()) {
IgniteBiTuple<WALPointer, WALRecord> next = stIt.nextX();
final WALPointer pointer = next.get1();
final WALRecord record = next.get2();
if (stat != null)
stat.registerRecord(record, pointer, false);
if (printRecords)
System.out.println("[A] " + record);
}
}
}
System.err.flush();
if (stat != null)
System.out.println("Statistic collected:\n" + stat.toString());
}
use of org.apache.ignite.logger.NullLogger in project ignite by apache.
the class JdbcThinConnection method createBinaryCtx.
/**
* Create new binary context.
*/
private BinaryContext createBinaryCtx(JdbcBinaryMetadataHandler metaHnd, JdbcMarshallerContext marshCtx) {
BinaryMarshaller marsh = new BinaryMarshaller();
marsh.setContext(marshCtx);
BinaryConfiguration binCfg = new BinaryConfiguration().setCompactFooter(true);
BinaryContext ctx = new BinaryContext(metaHnd, new IgniteConfiguration(), new NullLogger());
ctx.configure(marsh, binCfg);
ctx.registerUserTypesSchema();
return ctx;
}
use of org.apache.ignite.logger.NullLogger in project ignite by apache.
the class JmhStreamerAddDataBenchmark method getConfiguration.
/**
* Create Ignite configuration.
*
* @return Ignite configuration.
*/
private IgniteConfiguration getConfiguration(String cfgName, boolean isClient) {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setGridLogger(new NullLogger());
cfg.setIgniteInstanceName(cfgName);
if (isClient) {
cfg.setClientMode(true);
cfg.setCacheConfiguration(defaultCacheConfiguration(IGNITE_CLIENT_CACHE_NAME));
} else
cfg.setCacheConfiguration(defaultCacheConfiguration("server"));
return cfg;
}
Aggregations