Examples of CatalogBuilder


Examples of thredds.catalog2.builder.CatalogBuilder

          throws URISyntaxException, ThreddsXmlParserException, BuilderException
  {
      String catAsString = LargeCatalogReadUtils.createExampleRadarServiceCatalogAsString( 9112 );

      InvCatalogImpl cat = null;
      CatalogBuilder catalogBuilder = null;

      long cum = 0;
    long cum2 = 0;
    int numAttempts = 100;
    for ( int i = 0; i < numAttempts; i++ )
    {
      long start = System.currentTimeMillis();
      cat = LargeCatalogReadUtils.parseCatalogIntoInvCatalogImpl( catAsString, catURL );
      long done = System.currentTimeMillis();
      long elapsed = done - start;

        BuilderIssues bldIssues = new BuilderIssues();

      start = System.currentTimeMillis();
      catalogBuilder = LargeCatalogReadUtils.parseCatalogIntoBuilder( catAsString, catURL );
      BuilderIssues issues = catalogBuilder.getIssues();
      if ( ! issues.isValid() )
          System.out.println( "Invalid catalog [" + i + "]: " + bldIssues.toString() );
      catalogBuilder.build();
      done = System.currentTimeMillis();
      long elapsed2 = done - start;

      cum+=elapsed;
      cum2+=elapsed2;
      System.out.println( "Read catalog ["+i+"]: InvCat=" + elapsed + " stax=" + elapsed2 + "\n" );
    }
    System.out.println( "Cum=" + cum );
    System.out.println( "Avg=" + cum/ numAttempts );
    System.out.println( "CumStax=" + cum2 );
    System.out.println( "AvgStax=" + cum2/ numAttempts );

      System.out.println( "InvCat" );
    StringBuilder sb = new StringBuilder();
    if ( cat.check( sb ) )
      System.out.println( "Failed check:\n" + sb );
    else
      System.out.println( "OK check:\n" + sb );

      System.out.println( "thredds.catalog2" );
      BuilderIssues bldIssues = catalogBuilder.getIssues();
      if ( ! bldIssues.isValid() )
          System.out.println( "Invalid catalog: " + bldIssues.toString() );
      else
          System.out.println( "Valid catalog: " + ( bldIssues.isEmpty() ? "" : bldIssues.toString()) );
View Full Code Here

Examples of thredds.catalog2.builder.CatalogBuilder

                   BuilderException
    {
        String modelsCatUrlString = "http://motherlode.ucar.edu:8080/thredds/idd/models.xml";

       // InvCatalogImpl invCatalog = LargeCatalogReadUtils.parseCatalogIntoInvCatalogImpl( modelsCatUrlString );
        CatalogBuilder catalogBuilder = LargeCatalogReadUtils.parseCatalogIntoBuilder( modelsCatUrlString );

       // LargeCatalogReadUtils.measureSize( invCatalog );

       // LargeCatalogReadUtils.measureSize( catalogBuilder );

        Catalog catalog = catalogBuilder.build();

       // LargeCatalogReadUtils.measureSize( catalog );

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.