org.infinispan.commons.logging.Log.infof()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中org.infinispan.commons.logging.Log.infof()方法的一些代码示例,展示了Log.infof()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log.infof()方法的具体详情如下:
包路径:org.infinispan.commons.logging.Log
类名称:Log
方法名:infof

Log.infof介绍

暂无

代码示例

代码示例来源:origin: org.infinispan/infinispan-commons

private static void warnLegacy(String oldKey, String newKey) {
 if (log.isInfoEnabled())
   log.infof("Could not find value for key %1$s, but did find value under deprecated key %2$s. Please use %1$s as support for %2$s will eventually be discontinued.",
       newKey, oldKey);
}

代码示例来源:origin: org.infinispan/infinispan-commons

@Test(expected = IllegalArgumentException.class)
public void testInvalidBranch2() {
 long seed = System.currentTimeMillis();
 log.infof("[testInvalidBranch2] seed: %s", seed);
 Random random = new Random(seed);
 byte[] branch = new byte[65]; //max is 64
 random.nextBytes(branch);
 Xid xid = XidImpl.create(random.nextInt(), new byte[]{0}, branch);
 log.debugf("Invalid XID: %s", xid);
}

代码示例来源:origin: org.infinispan/infinispan-commons

@Test(expected = IllegalArgumentException.class)
public void testInvalidGlobalTransaction2() {
 long seed = System.currentTimeMillis();
 log.infof("[testInvalidGlobalTransaction2] seed: %s", seed);
 Random random = new Random(seed);
 byte[] globalTx = new byte[65]; //max is 64
 random.nextBytes(globalTx);
 Xid xid = XidImpl.create(random.nextInt(), globalTx, new byte[]{0});
 log.debugf("Invalid XID: %s", xid);
}

代码示例来源:origin: org.infinispan/infinispan-avro-server

/**
* Registers the remote value wrapper interceptor in the cache before it gets started.
*/
@Override
public void cacheStarting(ComponentRegistry cr, Configuration cfg, String cacheName) {
 if (!cacheName.equals(Support.AVRO_METADATA_CACHE_NAME)) {
   if (cfg.indexing().index().isEnabled() && !cfg.compatibility().enabled()) {
    log.infof("Registering RemoteAvroValueWrapperInterceptor for cache %s", cacheName);
    createRemoteIndexingInterceptor(cr, cfg);
   }
 }
}

代码示例来源:origin: org.infinispan/infinispan-commons

@Test(expected = IllegalArgumentException.class)
public void testInvalidGlobalTransaction() {
 long seed = System.currentTimeMillis();
 log.infof("[testInvalidGlobalTransaction] seed: %s", seed);
 Random random = new Random(seed);
 Xid xid = XidImpl.create(random.nextInt(), Util.EMPTY_BYTE_ARRAY, new byte[]{0});
 log.debugf("Invalid XID: %s", xid);
}

代码示例来源:origin: org.infinispan/infinispan-commons

@Test(expected = IllegalArgumentException.class)
public void testInvalidBranch() {
 long seed = System.currentTimeMillis();
 log.infof("[testInvalidBranch] seed: %s", seed);
 Random random = new Random(seed);
 Xid xid = XidImpl.create(random.nextInt(), new byte[]{0}, Util.EMPTY_BYTE_ARRAY);
 log.debugf("Invalid XID: %s", xid);
}

代码示例来源:origin: org.infinispan/infinispan-commons

@Test
public void testMarshalling() throws IOException, ClassNotFoundException {
 long seed = System.currentTimeMillis();
 log.infof("[testMarshalling] seed: %s", seed);
 Random random = new Random(seed);
 int formatId = random.nextInt();
 byte[] tx = new byte[random.nextInt(64) + 1];
 byte[] branch = new byte[random.nextInt(64) + 1];
 random.nextBytes(tx);
 random.nextBytes(branch);
 XidImpl xid = XidImpl.create(formatId, tx, branch);
 log.debugf("XID: %s", xid);
 ByteArrayOutputStream bos = new ByteArrayOutputStream(256);
 ObjectOutput oo = new ObjectOutputStream(bos);
 XidImpl.writeTo(oo, xid);
 oo.flush();
 oo.close();
 bos.close();
 byte[] marshalled = bos.toByteArray();
 log.debugf("Size: %s", marshalled.length);
 ByteArrayInputStream bis = new ByteArrayInputStream(marshalled);
 ObjectInput oi = new ObjectInputStream(bis);
 XidImpl otherXid = XidImpl.readFrom(oi);
 oi.close();
 bis.close();
 log.debugf("other XID: %s", xid);
 Assert.assertEquals(xid, otherXid);
}

代码示例来源:origin: org.infinispan/infinispan-commons

@Test
public void testMarshallingMaxSize() throws IOException, ClassNotFoundException {
 long seed = System.currentTimeMillis();
 log.infof("[testMarshallingMaxSize] seed: %s", seed);
 Random random = new Random(seed);
 int formatId = random.nextInt();
 byte[] tx = new byte[Xid.MAXGTRIDSIZE];
 byte[] branch = new byte[Xid.MAXBQUALSIZE];
 random.nextBytes(tx);
 random.nextBytes(branch);
 XidImpl xid = XidImpl.create(formatId, tx, branch);
 log.debugf("XID: %s", xid);
 ByteArrayOutputStream bos = new ByteArrayOutputStream(256);
 ObjectOutput oo = new ObjectOutputStream(bos);
 XidImpl.writeTo(oo, xid);
 oo.flush();
 oo.close();
 bos.close();
 byte[] marshalled = bos.toByteArray();
 log.debugf("Size: %s", marshalled.length);
 ByteArrayInputStream bis = new ByteArrayInputStream(marshalled);
 ObjectInput oi = new ObjectInputStream(bis);
 XidImpl otherXid = XidImpl.readFrom(oi);
 oi.close();
 bis.close();
 log.debugf("other XID: %s", xid);
 Assert.assertEquals(xid, otherXid);
}

代码示例来源:origin: org.infinispan/infinispan-commons

@Test
public void testCorrectDataStored() {
 long seed = System.currentTimeMillis();
 log.infof("[testCorrectDataStored] seed: %s", seed);
 Random random = new Random(seed);
 int formatId = random.nextInt();
 byte[] tx = new byte[random.nextInt(64) + 1];
 byte[] branch = new byte[random.nextInt(64) + 1];
 random.nextBytes(tx);
 random.nextBytes(branch);
 Xid xid = XidImpl.create(formatId, tx, branch);
 log.debugf("XID: %s", xid);
 Assert.assertEquals(formatId, xid.getFormatId());
 Assert.assertArrayEquals(tx, xid.getGlobalTransactionId());
 Assert.assertArrayEquals(branch, xid.getBranchQualifier());
 Xid sameXid = XidImpl.create(formatId, tx, branch);
 log.debugf("same XID: %s", sameXid);
 Assert.assertEquals(xid, sameXid);
}

代码示例来源:origin: org.infinispan/infinispan-commons

@Test
public void testCorrectDataStoredMaxSize() {
 long seed = System.currentTimeMillis();
 log.infof("[testCorrectDataStoredMaxSize] seed: %s", seed);
 Random random = new Random(seed);
 int formatId = random.nextInt();
 byte[] tx = new byte[Xid.MAXGTRIDSIZE];
 byte[] branch = new byte[Xid.MAXBQUALSIZE];
 random.nextBytes(tx);
 random.nextBytes(branch);
 Xid xid = XidImpl.create(formatId, tx, branch);
 log.debugf("XID: %s", xid);
 Assert.assertEquals(formatId, xid.getFormatId());
 Assert.assertArrayEquals(tx, xid.getGlobalTransactionId());
 Assert.assertArrayEquals(branch, xid.getBranchQualifier());
 Xid sameXid = XidImpl.create(formatId, tx, branch);
 log.debugf("same XID: %s", sameXid);
 Assert.assertEquals(xid, sameXid);
}

相关文章

微信公众号

最新文章

更多