Package com.cloudera.recordbreaker.analyzer

Examples of com.cloudera.recordbreaker.analyzer.SchemaSummary


        List<SchemaSummary> list = fe.getAnalyzer().getPrecachedSchemaSummaries();
        ListView<SchemaSummary> listview = new ListView<SchemaSummary>("listview", list) {
          protected void populateItem(ListItem<SchemaSummary> item) {
            long localStart = System.currentTimeMillis();

            SchemaSummary ss = item.getModelObject();
            item.add(new Label("schemadesc", ss.getDesc()));

            StringBuffer schemalabel = new StringBuffer();
            try {
              List<List<JsonNode>> listOfSchemaElts = SchemaPage.getSchemaDigest(ss.getIdentifier());
              for (Iterator<JsonNode> it = listOfSchemaElts.get(0).iterator(); it.hasNext(); ) {
                JsonNode curNode = it.next();
                schemalabel.append(curNode.get("name"));
                if (it.hasNext()) {
                  schemalabel.append(", ");
                }
              }
            } catch (IOException iex) {
            }
            String schemaUrl = urlFor(SchemaPage.class, new PageParameters("schemaid=" + ss.getSchemaId())).toString();
            item.add(new ExternalLink("schemalabellink", schemaUrl, schemalabel.toString()));

            List<TypeGuessSummary> typeGuesses = ss.getTypeGuesses();
            for (int i = 0; i < Math.min(1, typeGuesses.size()); i++) {
              TypeGuessSummary curTGS = typeGuesses.get(i);
              FileSummary fs = curTGS.getFileSummary();

              PageParameters pars = new PageParameters();
View Full Code Here


            ListView<TypeGuessSummary> observationList = new ListView<TypeGuessSummary>("observations", tgses) {
              protected void populateItem(ListItem<TypeGuessSummary> item) {
                TypeGuessSummary tgs = item.getModelObject();
                FileSummary fs = tgs.getFileSummary();
                SchemaSummary ss = tgs.getSchemaSummary();

                String fileUrl = urlFor(FilePage.class, new PageParameters("fid=" + fs.getFid())).toString();
                item.add(new ExternalLink("filelink", fileUrl, fs.getFname()));

                String schemaUrl = urlFor(SchemaPage.class, new PageParameters("schemaid=" + ss.getSchemaId())).toString();
                item.add(new ExternalLink("schemalink", schemaUrl, "Schema"));
              }
            };
            add(observationList);
          } catch (NumberFormatException nfe) {
View Full Code Here

        long numFilesWithSchema = -1;
        String schemaDescription = "";
        if (schemaidStr != null) {
          try {
            long schemaId = Long.parseLong(schemaidStr);
            SchemaSummary ss = new SchemaSummary(fe.getAnalyzer(), schemaId);
            if (ss.getIdentifier().length() > 0) {
              listOfSchemaElts = getSchemaDigest(ss.getIdentifier());
            } else {
              listOfSchemaElts = new ArrayList<List<JsonNode>>();
            }
            schemaDescription = ss.getDesc();
            numFilesWithSchema = fe.getAnalyzer().countFilesForSchema(schemaId);
          } catch (NumberFormatException nfe) {
            nfe.printStackTrace();
          } catch (IOException ie) {
            ie.printStackTrace();           
View Full Code Here

            // Schema data
            if (tgses.size() > 0) {
              TypeGuessSummary tgs = tgses.get(0);
              TypeSummary ts = tgs.getTypeSummary();         
              SchemaSummary ss = tgs.getSchemaSummary();
              String typeUrl = urlFor(FiletypePage.class, new PageParameters("typeid=" + ts.getTypeId())).toString();
              String schemaUrl = urlFor(SchemaPage.class, new PageParameters("schemaid=" + ss.getSchemaId())).toString();
              add(new Label("typelink", "<a href=\"" + typeUrl + "\">" + ts.getLabel() + "</a>").setEscapeModelStrings(false));
              add(new Label("schemalink", "<a href=\"" + schemaUrl + "\">" + "Schema" + "</a>").setEscapeModelStrings(false));
            } else {
              add(new Label("typelink", ""));
              add(new Label("schemalink", ""));
View Full Code Here

              // 6-7.  Fields that have link conditional on read access AND the existence of relevant info.
              if (accessCtrl.hasReadAccess(fs)) {
                List<TypeGuessSummary> tgs = fs.getTypeGuesses();
                if (tgs.size() > 0) {
                  TypeSummary ts = tgs.get(0).getTypeSummary();
                  SchemaSummary ss = tgs.get(0).getSchemaSummary();

                  String typeUrl = urlFor(FiletypePage.class, new PageParameters("typeid=" + ts.getTypeId())).toString();
                  item.add(new Label("typelabel", "<a href=\"" + typeUrl + "\">" + ts.getLabel() + "</a>").setEscapeModelStrings(false));

                  String schemaUrl = urlFor(SchemaPage.class, new PageParameters("schemaid=" + ss.getSchemaId())).toString();
                  item.add(new Label("schemalabel", "<a href=\"" + schemaUrl + "\">" + "Schema" + "</a>").setEscapeModelStrings(false));                 
                } else {
                  item.add(new Label("typelabel", ""));
                  item.add(new Label("schemalabel", ""));
                }
View Full Code Here

TOP

Related Classes of com.cloudera.recordbreaker.analyzer.SchemaSummary

Copyright © 2018 www.massapicom. 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.