当前位置: 首页>>代码示例>>Java>>正文


Java BaseDistributedSearchTestCase.compare方法代码示例

本文整理汇总了Java中org.apache.solr.BaseDistributedSearchTestCase.compare方法的典型用法代码示例。如果您正苦于以下问题:Java BaseDistributedSearchTestCase.compare方法的具体用法?Java BaseDistributedSearchTestCase.compare怎么用?Java BaseDistributedSearchTestCase.compare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.solr.BaseDistributedSearchTestCase的用法示例。


在下文中一共展示了BaseDistributedSearchTestCase.compare方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testRandom

import org.apache.solr.BaseDistributedSearchTestCase; //导入方法依赖的package包/类
public void testRandom() throws Exception {
  // Random r = random;
  // let's keep it deterministic since just the wrong
  // random stuff could cause failure because of an OOM (too big)

  NamedList nl;
  NamedList res;
  String cmp;

  for (int i=0; i<10000; i++) { // pump up the iterations for good stress testing
    nl = rNamedList(3);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    new JavaBinCodec(null).marshal(nl,baos);
    byte[] arr = baos.toByteArray();
    // System.out.println(arr.length);
    res = (NamedList) new JavaBinCodec().unmarshal(new ByteArrayInputStream(arr));
    cmp = BaseDistributedSearchTestCase.compare(nl, res, 0, null);

    if (cmp != null) {
      System.out.println(nl);
      System.out.println(res);
      fail(cmp);
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:26,代码来源:TestNamedListCodec.java

示例2: doTestIndexAndConfigReplication

import org.apache.solr.BaseDistributedSearchTestCase; //导入方法依赖的package包/类
@Test
public void doTestIndexAndConfigReplication() throws Exception {
  clearIndexWithReplication();

  nDocs--;
  for (int i = 0; i < nDocs; i++)
    index(masterClient, "id", i, "name", "name = " + i);

  masterClient.commit();

  NamedList masterQueryRsp = rQuery(nDocs, "*:*", masterClient);
  SolrDocumentList masterQueryResult = (SolrDocumentList) masterQueryRsp.get("response");
  assertEquals(nDocs, numFound(masterQueryRsp));

  //get docs from slave and check if number is equal to master
  NamedList slaveQueryRsp = rQuery(nDocs, "*:*", slaveClient);
  SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
  assertEquals(nDocs, numFound(slaveQueryRsp));

  //compare results
  String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
  assertEquals(null, cmp);
  
  assertVersions(masterClient, slaveClient);

  //start config files replication test
  masterClient.deleteByQuery("*:*");
  masterClient.commit();

  //change the schema on master
  master.copyConfigFile(CONF_DIR + "schema-replication2.xml", "schema.xml");

  masterJetty.stop();

  masterJetty = createJetty(master);
  masterClient.shutdown();
  masterClient = createNewSolrServer(masterJetty.getLocalPort());

  slave.setTestPort(masterJetty.getLocalPort());
  slave.copyConfigFile(slave.getSolrConfigFile(), "solrconfig.xml");

  slaveJetty.stop();

  // setup an xslt dir to force subdir file replication
  File masterXsltDir = new File(master.getConfDir() + File.separator + "xslt");
  File masterXsl = new File(masterXsltDir, "dummy.xsl");
  assertTrue("could not make dir " + masterXsltDir, masterXsltDir.mkdirs());
  assertTrue(masterXsl.createNewFile());

  File slaveXsltDir = new File(slave.getConfDir() + File.separator + "xslt");
  File slaveXsl = new File(slaveXsltDir, "dummy.xsl");
  assertFalse(slaveXsltDir.exists());

  slaveJetty = createJetty(slave);
  slaveClient.shutdown();
  slaveClient = createNewSolrServer(slaveJetty.getLocalPort());

  //add a doc with new field and commit on master to trigger snappull from slave.
  index(masterClient, "id", "2000", "name", "name = " + 2000, "newname", "newname = " + 2000);
  masterClient.commit();

  assertEquals(1, numFound( rQuery(1, "*:*", masterClient)));
  
  slaveQueryRsp = rQuery(1, "*:*", slaveClient);
  assertVersions(masterClient, slaveClient);
  SolrDocument d = ((SolrDocumentList) slaveQueryRsp.get("response")).get(0);
  assertEquals("newname = 2000", (String) d.getFieldValue("newname"));

  assertTrue(slaveXsltDir.isDirectory());
  assertTrue(slaveXsl.exists());
  
  checkForSingleIndex(masterJetty);
  checkForSingleIndex(slaveJetty);
  
}
 
开发者ID:europeana,项目名称:search,代码行数:76,代码来源:TestReplicationHandler.java

示例3: doTestStopPoll

import org.apache.solr.BaseDistributedSearchTestCase; //导入方法依赖的package包/类
@Test
public void doTestStopPoll() throws Exception {
  clearIndexWithReplication();

  // Test:
  // setup master/slave.
  // stop polling on slave, add a doc to master and verify slave hasn't picked it.
  nDocs--;
  for (int i = 0; i < nDocs; i++)
    index(masterClient, "id", i, "name", "name = " + i);

  masterClient.commit();

  NamedList masterQueryRsp = rQuery(nDocs, "*:*", masterClient);
  SolrDocumentList masterQueryResult = (SolrDocumentList) masterQueryRsp.get("response");
  assertEquals(nDocs, numFound(masterQueryRsp));

  //get docs from slave and check if number is equal to master
  NamedList slaveQueryRsp = rQuery(nDocs, "*:*", slaveClient);
  SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
  assertEquals(nDocs, numFound(slaveQueryRsp));

  //compare results
  String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
  assertEquals(null, cmp);

  // start stop polling test
  invokeReplicationCommand(slaveJetty.getLocalPort(), "disablepoll");
  
  index(masterClient, "id", 501, "name", "name = " + 501);
  masterClient.commit();

  //get docs from master and check if number is equal to master
  assertEquals(nDocs+1, numFound(rQuery(nDocs+1, "*:*", masterClient)));
  
  // NOTE: this test is wierd, we want to verify it DOESNT replicate...
  // for now, add a sleep for this.., but the logic is wierd.
  Thread.sleep(3000);
  
  //get docs from slave and check if number is not equal to master; polling is disabled
  assertEquals(nDocs, numFound(rQuery(nDocs, "*:*", slaveClient)));

  // re-enable replication
  invokeReplicationCommand(slaveJetty.getLocalPort(), "enablepoll");

  assertEquals(nDocs+1, numFound(rQuery(nDocs+1, "*:*", slaveClient)));
}
 
开发者ID:europeana,项目名称:search,代码行数:48,代码来源:TestReplicationHandler.java

示例4: doTestReplicateAfterStartup

import org.apache.solr.BaseDistributedSearchTestCase; //导入方法依赖的package包/类
@Test
public void doTestReplicateAfterStartup() throws Exception {
  //stop slave
  slaveJetty.stop();

  nDocs--;
  masterClient.deleteByQuery("*:*");

  masterClient.commit();



  //change solrconfig having 'replicateAfter startup' option on master
  master.copyConfigFile(CONF_DIR + "solrconfig-master2.xml",
                        "solrconfig.xml");

  masterJetty.stop();

  masterJetty = createJetty(master);
  masterClient.shutdown();
  masterClient = createNewSolrServer(masterJetty.getLocalPort());
  
  for (int i = 0; i < nDocs; i++)
    index(masterClient, "id", i, "name", "name = " + i);

  masterClient.commit();
  
  NamedList masterQueryRsp = rQuery(nDocs, "*:*", masterClient);
  SolrDocumentList masterQueryResult = (SolrDocumentList) masterQueryRsp.get("response");
  assertEquals(nDocs, masterQueryResult.getNumFound());
  

  slave.setTestPort(masterJetty.getLocalPort());
  slave.copyConfigFile(slave.getSolrConfigFile(), "solrconfig.xml");

  //start slave
  slaveJetty = createJetty(slave);
  slaveClient.shutdown();
  slaveClient = createNewSolrServer(slaveJetty.getLocalPort());

  //get docs from slave and check if number is equal to master
  NamedList slaveQueryRsp = rQuery(nDocs, "*:*", slaveClient);
  SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
  assertEquals(nDocs, slaveQueryResult.getNumFound());

  //compare results
  String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
  assertEquals(null, cmp);

}
 
开发者ID:europeana,项目名称:search,代码行数:51,代码来源:TestReplicationHandler.java

示例5: doTestReplicateAfterStartupWithNoActivity

import org.apache.solr.BaseDistributedSearchTestCase; //导入方法依赖的package包/类
@Test
public void doTestReplicateAfterStartupWithNoActivity() throws Exception {
  useFactory(null);
  try {
    
    // stop slave
    slaveJetty.stop();
    
    nDocs--;
    masterClient.deleteByQuery("*:*");
    
    masterClient.commit();
    
    // change solrconfig having 'replicateAfter startup' option on master
    master.copyConfigFile(CONF_DIR + "solrconfig-master2.xml",
        "solrconfig.xml");
    
    masterJetty.stop();
    
    masterJetty = createJetty(master);
    masterClient.shutdown();
    masterClient = createNewSolrServer(masterJetty.getLocalPort());
    
    for (int i = 0; i < nDocs; i++)
      index(masterClient, "id", i, "name", "name = " + i);
    
    masterClient.commit();
    
    // now we restart to test what happens with no activity before the slave
    // tries to
    // replicate
    masterJetty.stop();
    masterJetty.start(true);
    
    // masterClient = createNewSolrServer(masterJetty.getLocalPort());
    
    NamedList masterQueryRsp = rQuery(nDocs, "*:*", masterClient);
    SolrDocumentList masterQueryResult = (SolrDocumentList) masterQueryRsp
        .get("response");
    assertEquals(nDocs, masterQueryResult.getNumFound());
    
    slave.setTestPort(masterJetty.getLocalPort());
    slave.copyConfigFile(slave.getSolrConfigFile(), "solrconfig.xml");
    
    // start slave
    slaveJetty = createJetty(slave);
    slaveClient.shutdown();
    slaveClient = createNewSolrServer(slaveJetty.getLocalPort());
    
    // get docs from slave and check if number is equal to master
    NamedList slaveQueryRsp = rQuery(nDocs, "*:*", slaveClient);
    SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp
        .get("response");
    assertEquals(nDocs, slaveQueryResult.getNumFound());
    
    // compare results
    String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult,
        slaveQueryResult, 0, null);
    assertEquals(null, cmp);
    
  } finally {
    resetFactory();
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:65,代码来源:TestReplicationHandler.java

示例6: doTestIndexAndConfigReplication

import org.apache.solr.BaseDistributedSearchTestCase; //导入方法依赖的package包/类
@Test
public void doTestIndexAndConfigReplication() throws Exception {
  clearIndexWithReplication();

  nDocs--;
  for (int i = 0; i < nDocs; i++)
    index(masterClient, "id", i, "name", "name = " + i);

  masterClient.commit();

  NamedList masterQueryRsp = rQuery(nDocs, "*:*", masterClient);
  SolrDocumentList masterQueryResult = (SolrDocumentList) masterQueryRsp.get("response");
  assertEquals(nDocs, masterQueryResult.getNumFound());

  //get docs from slave and check if number is equal to master
  NamedList slaveQueryRsp = rQuery(nDocs, "*:*", slaveClient);
  SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
  assertEquals(nDocs, slaveQueryResult.getNumFound());

  //compare results
  String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
  assertEquals(null, cmp);

  //start config files replication test
  masterClient.deleteByQuery("*:*");
  masterClient.commit();

  //change the schema on master
  master.copyConfigFile(CONF_DIR + "schema-replication2.xml", "schema.xml");

  masterJetty.stop();

  masterJetty = createJetty(master);
  masterClient = createNewSolrServer(masterJetty.getLocalPort());

  slave.setTestPort(masterJetty.getLocalPort());
  slave.copyConfigFile(slave.getSolrConfigFile(), "solrconfig.xml");

  slaveJetty.stop();

  // setup an xslt dir to force subdir file replication
  File masterXsltDir = new File(master.getConfDir() + File.separator + "xslt");
  File masterXsl = new File(masterXsltDir, "dummy.xsl");
  assertTrue("could not make dir " + masterXsltDir, masterXsltDir.mkdirs());
  assertTrue(masterXsl.createNewFile());

  File slaveXsltDir = new File(slave.getConfDir() + File.separator + "xslt");
  File slaveXsl = new File(slaveXsltDir, "dummy.xsl");
  assertFalse(slaveXsltDir.exists());

  slaveJetty = createJetty(slave);
  slaveClient = createNewSolrServer(slaveJetty.getLocalPort());

  //add a doc with new field and commit on master to trigger snappull from slave.
  index(masterClient, "id", "2000", "name", "name = " + 2000, "newname", "newname = " + 2000);
  masterClient.commit();

  NamedList masterQueryRsp2 = rQuery(1, "*:*", masterClient);
  SolrDocumentList masterQueryResult2 = (SolrDocumentList) masterQueryRsp2.get("response");
  assertEquals(1, masterQueryResult2.getNumFound());

  slaveQueryRsp = rQuery(1, "*:*", slaveClient);
  SolrDocument d = ((SolrDocumentList) slaveQueryRsp.get("response")).get(0);
  assertEquals("newname = 2000", (String) d.getFieldValue("newname"));

  assertTrue(slaveXsltDir.isDirectory());
  assertTrue(slaveXsl.exists());
  
  checkForSingleIndex(masterJetty);
  checkForSingleIndex(slaveJetty);
  
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:73,代码来源:TestReplicationHandler.java

示例7: doTestStopPoll

import org.apache.solr.BaseDistributedSearchTestCase; //导入方法依赖的package包/类
@Test
public void doTestStopPoll() throws Exception {
  clearIndexWithReplication();

  // Test:
  // setup master/slave.
  // stop polling on slave, add a doc to master and verify slave hasn't picked it.
  nDocs--;
  for (int i = 0; i < nDocs; i++)
    index(masterClient, "id", i, "name", "name = " + i);

  masterClient.commit();

  NamedList masterQueryRsp = rQuery(nDocs, "*:*", masterClient);
  SolrDocumentList masterQueryResult = (SolrDocumentList) masterQueryRsp.get("response");
  assertEquals(nDocs, masterQueryResult.getNumFound());

  //get docs from slave and check if number is equal to master
  NamedList slaveQueryRsp = rQuery(nDocs, "*:*", slaveClient);
  SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
  assertEquals(nDocs, slaveQueryResult.getNumFound());

  //compare results
  String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
  assertEquals(null, cmp);

  // start stop polling test
  invokeReplicationCommand(slaveJetty.getLocalPort(), "disablepoll");
  
  index(masterClient, "id", 501, "name", "name = " + 501);
  masterClient.commit();

  //get docs from master and check if number is equal to master
  masterQueryRsp = rQuery(nDocs+1, "*:*", masterClient);
  masterQueryResult = (SolrDocumentList) masterQueryRsp.get("response");
  assertEquals(nDocs+1, masterQueryResult.getNumFound());
  
  // NOTE: this test is wierd, we want to verify it DOESNT replicate...
  // for now, add a sleep for this.., but the logic is wierd.
  Thread.sleep(3000);
  
  //get docs from slave and check if number is not equal to master; polling is disabled
  slaveQueryRsp = rQuery(nDocs, "*:*", slaveClient);
  slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
  assertEquals(nDocs, slaveQueryResult.getNumFound());

  // re-enable replication
  invokeReplicationCommand(slaveJetty.getLocalPort(), "enablepoll");

  slaveQueryRsp = rQuery(nDocs+1, "*:*", slaveClient);
  slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
  assertEquals(nDocs+1, slaveQueryResult.getNumFound());   
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:54,代码来源:TestReplicationHandler.java

示例8: doTestReplicateAfterStartupWithNoActivity

import org.apache.solr.BaseDistributedSearchTestCase; //导入方法依赖的package包/类
@Test
public void doTestReplicateAfterStartupWithNoActivity() throws Exception {
  useFactory(null);
  try {
    
    // stop slave
    slaveJetty.stop();
    
    nDocs--;
    masterClient.deleteByQuery("*:*");
    
    masterClient.commit();
    
    // change solrconfig having 'replicateAfter startup' option on master
    master.copyConfigFile(CONF_DIR + "solrconfig-master2.xml",
        "solrconfig.xml");
    
    masterJetty.stop();
    
    masterJetty = createJetty(master);
    masterClient = createNewSolrServer(masterJetty.getLocalPort());
    
    for (int i = 0; i < nDocs; i++)
      index(masterClient, "id", i, "name", "name = " + i);
    
    masterClient.commit();
    
    // now we restart to test what happens with no activity before the slave
    // tries to
    // replicate
    masterJetty.stop();
    masterJetty.start(true);
    
    // masterClient = createNewSolrServer(masterJetty.getLocalPort());
    
    NamedList masterQueryRsp = rQuery(nDocs, "*:*", masterClient);
    SolrDocumentList masterQueryResult = (SolrDocumentList) masterQueryRsp
        .get("response");
    assertEquals(nDocs, masterQueryResult.getNumFound());
    
    slave.setTestPort(masterJetty.getLocalPort());
    slave.copyConfigFile(slave.getSolrConfigFile(), "solrconfig.xml");
    
    // start slave
    slaveJetty = createJetty(slave);
    slaveClient = createNewSolrServer(slaveJetty.getLocalPort());
    
    // get docs from slave and check if number is equal to master
    NamedList slaveQueryRsp = rQuery(nDocs, "*:*", slaveClient);
    SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp
        .get("response");
    assertEquals(nDocs, slaveQueryResult.getNumFound());
    
    // compare results
    String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult,
        slaveQueryResult, 0, null);
    assertEquals(null, cmp);
    
  } finally {
    resetFactory();
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:63,代码来源:TestReplicationHandler.java

示例9: doTestReplicateAfterCoreReload

import org.apache.solr.BaseDistributedSearchTestCase; //导入方法依赖的package包/类
@Test
public void doTestReplicateAfterCoreReload() throws Exception {
  int docs = TEST_NIGHTLY ? 200000 : 0;
  
  //stop slave
  slaveJetty.stop();


  //change solrconfig having 'replicateAfter startup' option on master
  master.copyConfigFile(CONF_DIR + "solrconfig-master3.xml",
                        "solrconfig.xml");

  masterJetty.stop();

  masterJetty = createJetty(master);
  masterClient = createNewSolrServer(masterJetty.getLocalPort());

  masterClient.deleteByQuery("*:*");
  for (int i = 0; i < docs; i++)
    index(masterClient, "id", i, "name", "name = " + i);

  masterClient.commit();

  NamedList masterQueryRsp = rQuery(docs, "*:*", masterClient);
  SolrDocumentList masterQueryResult = (SolrDocumentList) masterQueryRsp.get("response");
  assertEquals(docs, masterQueryResult.getNumFound());
  
  slave.setTestPort(masterJetty.getLocalPort());
  slave.copyConfigFile(slave.getSolrConfigFile(), "solrconfig.xml");

  //start slave
  slaveJetty = createJetty(slave);
  slaveClient = createNewSolrServer(slaveJetty.getLocalPort());
  
  //get docs from slave and check if number is equal to master
  NamedList slaveQueryRsp = rQuery(docs, "*:*", slaveClient);
  SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
  assertEquals(docs, slaveQueryResult.getNumFound());
  
  //compare results
  String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
  assertEquals(null, cmp);
  
  Object version = getIndexVersion(masterClient).get("indexversion");
  NamedList<Object> commits = getCommits(masterClient);
  
  reloadCore(masterClient, "collection1");
  
  assertEquals(version, getIndexVersion(masterClient).get("indexversion"));
  assertEquals(commits.get("commits"), getCommits(masterClient).get("commits"));
  
  index(masterClient, "id", docs + 10, "name", "name = 1");
  index(masterClient, "id", docs + 20, "name", "name = 2");

  masterClient.commit();
  
  NamedList resp =  rQuery(docs + 2, "*:*", masterClient);
  masterQueryResult = (SolrDocumentList) resp.get("response");
  assertEquals(docs + 2, masterQueryResult.getNumFound());
  
  //get docs from slave and check if number is equal to master
  slaveQueryRsp = rQuery(docs + 2, "*:*", slaveClient);
  slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
  assertEquals(docs + 2, slaveQueryResult.getNumFound());
  
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:67,代码来源:TestReplicationHandler.java

示例10: doTestReplicateAfterStartup

import org.apache.solr.BaseDistributedSearchTestCase; //导入方法依赖的package包/类
@Test
public void doTestReplicateAfterStartup() throws Exception {
  //stop slave
  slaveJetty.stop();

  nDocs--;
  masterClient.deleteByQuery("*:*");

  masterClient.commit();



  //change solrconfig having 'replicateAfter startup' option on master
  master.copyConfigFile(CONF_DIR + "solrconfig-master2.xml",
                        "solrconfig.xml");

  masterJetty.stop();

  masterJetty = createJetty(master);
  masterClient = createNewSolrServer(masterJetty.getLocalPort());
  
  for (int i = 0; i < nDocs; i++)
    index(masterClient, "id", i, "name", "name = " + i);

  masterClient.commit();
  
  NamedList masterQueryRsp = rQuery(nDocs, "*:*", masterClient);
  SolrDocumentList masterQueryResult = (SolrDocumentList) masterQueryRsp.get("response");
  assertEquals(nDocs, masterQueryResult.getNumFound());
  

  slave.setTestPort(masterJetty.getLocalPort());
  slave.copyConfigFile(slave.getSolrConfigFile(), "solrconfig.xml");

  //start slave
  slaveJetty = createJetty(slave);
  slaveClient = createNewSolrServer(slaveJetty.getLocalPort());

  //get docs from slave and check if number is equal to master
  NamedList slaveQueryRsp = rQuery(nDocs, "*:*", slaveClient);
  SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
  assertEquals(nDocs, slaveQueryResult.getNumFound());

  //compare results
  String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
  assertEquals(null, cmp);

}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:49,代码来源:TestReplicationHandler.java


注:本文中的org.apache.solr.BaseDistributedSearchTestCase.compare方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。