Examples of Row


Examples of net.yacy.kelondro.blob.Tables.Row

            }
        }

        if (post != null && post.containsKey("removeAllFeedsNewList")) try {
            final Iterator<Row> plainIterator = sb.tables.iterator("rss");
            Row row;
            String messageurl;
            final List<byte[]> d = new ArrayList<byte[]>();
            while (plainIterator.hasNext()) {
                row = plainIterator.next();
                if (row == null) continue;
                messageurl = row.get("url", "");
                if (messageurl.length() == 0) continue;
                final byte[] api_pk = row.get("api_pk");
                final Row r = api_pk == null ? null : sb.tables.select("api", api_pk);
                if (r == null || !r.get("comment", "").matches(".*\\Q" + messageurl + "\\E.*")) {
                    d.add(row.getPK());
                }
            }
            for (final byte[] pk: d) {
                sb.tables.delete("rss", pk);
            }
        } catch (final IOException e) {
            Log.logException(e);
        } catch (final RowSpaceExceededException e) {
            Log.logException(e);
        }

        if (post != null && post.containsKey("removeSelectedFeedsScheduler")) {
            for (final Map.Entry<String, String> entry: post.entrySet()) {
                if (entry.getValue().startsWith("mark_")) try {
                    final byte[] pk = entry.getValue().substring(5).getBytes();
                    final Row rssRow = sb.tables.select("rss", pk);
                    final byte[] schedulerPK = rssRow.get("api_pk", (byte[]) null);
                    if (schedulerPK != null) sb.tables.delete("api", schedulerPK);
                    rssRow.remove("api_pk");
                    sb.tables.insert("rss", pk, rssRow);
                } catch (final IOException e) {
                    Log.logException(e);
                } catch (final RowSpaceExceededException e) {
                    Log.logException(e);
                }
            }
        }

        if (post != null && post.containsKey("removeAllFeedsScheduler")) try {
            final Iterator<Row> plainIterator = sb.tables.iterator("rss");
            Row row;
            String messageurl;
            final List<byte[]> d = new ArrayList<byte[]>();
            while (plainIterator.hasNext()) {
                row = plainIterator.next();
                if (row == null) continue;
                messageurl = row.get("url", "");
                if (messageurl.length() == 0) continue;
                final byte[] api_pk = row.get("api_pk");
                final Row r = api_pk == null ? null : sb.tables.select("api", api_pk);
                if (r != null && r.get("comment", "").matches(".*\\Q" + messageurl + "\\E.*")) {
                    d.add(row.getPK());
                }
            }
            for (final byte[] pk: d) {
                final Row rssRow = sb.tables.select("rss", pk);
                final byte[] schedulerPK = rssRow.get("api_pk", (byte[]) null);
                if (schedulerPK != null) sb.tables.delete("api", schedulerPK);
                rssRow.remove("api_pk");
                sb.tables.insert("rss", pk, rssRow);
            }
        } catch (final IOException e) {
            Log.logException(e);
        } catch (final RowSpaceExceededException e) {
            Log.logException(e);
        }

        if (post != null && post.containsKey("addSelectedFeedScheduler")) {
            for (final Map.Entry<String, String> entry: post.entrySet()) {
                if (entry.getValue().startsWith("mark_")) {
                    Row row;
                    try {
                        final byte [] pk = entry.getValue().substring(5).getBytes();
                        row = sb.tables.select("rss", pk);
                    } catch (final IOException e) {
                        Log.logException(e);
                        continue;
                    } catch (final RowSpaceExceededException e) {
                        Log.logException(e);
                        continue;
                    }
                    DigestURI url = null;
                    try {
                        url = new DigestURI(row.get("url", ""));
                    } catch (final MalformedURLException e) {
                        Log.logWarning("Load_RSS", "malformed url '" + row.get("url", "") + "': " + e.getMessage());
                        continue;
                    }
                    // load feeds concurrently to get better responsibility in web interface
                    new RSSLoader(sb, url).start();
                }
            }
        }

        if (post == null || (post != null && (
                post.containsKey("addSelectedFeedScheduler") ||
                post.containsKey("removeSelectedFeedsNewList") ||
                post.containsKey("removeAllFeedsNewList") ||
                post.containsKey("removeSelectedFeedsScheduler") ||
                post.containsKey("removeAllFeedsScheduler")
            ))) {
            try {
                // get list of primary keys from the api table with scheduled feed loading requests
                Tables.Row row;
                String messageurl;

                // check feeds
                int newc = 0, apic = 0;
                final Iterator<Row> plainIterator = sb.tables.iterator("rss");
                while (plainIterator.hasNext()) {
                    row = plainIterator.next();
                    if (row == null) continue;
                    messageurl = row.get("url", "");
                    if (messageurl.length() == 0) continue;
                    // get referrer
                    final DigestURI referrer = sb.getURL(Segments.Process.LOCALCRAWLING, row.get("referrer", "").getBytes());
                    // check if feed is registered in scheduler
                    final byte[] api_pk = row.get("api_pk");
                    final Row r = api_pk == null ? null : sb.tables.select("api", api_pk);
                    if (r != null && r.get("comment", "").matches(".*\\Q" + messageurl + "\\E.*")) {
                        // this is a recorded entry
                        final Date date_next_exec = r.get(WorkTables.TABLE_API_COL_DATE_NEXT_EXEC, (Date) null);
                        prop.put("showscheduledfeeds_list_" + apic + "_pk", UTF8.String(row.getPK()));
                        prop.put("showscheduledfeeds_list_" + apic + "_count", apic);
                        prop.putXML("showscheduledfeeds_list_" + apic + "_rss", messageurl);
                        prop.putXML("showscheduledfeeds_list_" + apic + "_title", row.get("title", ""));
                        prop.putXML("showscheduledfeeds_list_" + apic + "_referrer", referrer == null ? "#" : referrer.toNormalform(true, false));
View Full Code Here

Examples of net.yacy.kelondro.index.Row

            final HashMap<String, Integer> positiveHashes = new HashMap<String, Integer>(); // a mapping from an url hash to Integer (count of votes)
            accumulateVotes(sb , negativeHashes, positiveHashes, yacyNewsPool.INCOMING_DB);
            //accumulateVotes(negativeHashes, positiveHashes, yacyNewsPool.OUTGOING_DB);
            //accumulateVotes(negativeHashes, positiveHashes, yacyNewsPool.PUBLISHED_DB);
            final ScoreMap<String> ranking = new ConcurrentScoreMap<String>(); // score cluster for url hashes
            final Row rowdef = new Row("String url-255, String title-120, String description-120, String refid-" + (GenericFormatter.PATTERN_SHORT_SECOND.length() + 12), NaturalOrder.naturalOrder);
            final HashMap<String, Entry> surftips = new HashMap<String, Entry>(); // a mapping from an url hash to a kelondroRow.Entry with display properties
            accumulateSurftips(sb, surftips, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.INCOMING_DB);
            //accumulateSurftips(surftips, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.OUTGOING_DB);
            //accumulateSurftips(surftips, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.PUBLISHED_DB);
       
View Full Code Here

Examples of nextapp.echo2.app.Row

    public void addControl(String groupName, Component control) {
        this.addControl(groupName, groupName, control);
    }

    public void addSeparator(String groupName) {
        Row row = new Row();
        ColumnLayoutData layout = new ColumnLayoutData();
        layout.setHeight(new JbsExtent(15, JbsExtent.PX));
        row.setLayoutData(layout);
        this.addControl(groupName, row);
    }
View Full Code Here

Examples of noNamespace.ROWDocument.ROW

        ResultSet rs = oraConnection.prepareCall(newSql).executeQuery();
        int line=0;

        while(rs.next()){
            line++;
            ROW row = tableData.addNewROW();
            Rep("Exporting record "+ line);
            for(int i=0;i<colCount;i++){
                COLUMN col = row.addNewCOLUMN();
                col.setCOLUMNNAME(columns.getColumnName(i+1));
                col.setDATA(getColumnData(rs,i+1,columns.getColumnTypeName(i+1)));
            }
        }
        Rep("Finished!");
View Full Code Here

Examples of oracle.jbo.Row

        try {
            final RowSetIterator iter = vo.createRowSetIterator("__lookup__");
            iter.setRowValidation(false);
            try {
                while (iter.hasNext()) {
                    final Row row = iter.next();
                    boolean isLookup = true;
                    // Compare the values of all the lookup attributes.
                    for (String tableAttrName : lookups.keySet()) {
                        final Object rowVal = row.getAttribute(tableAttrName);
                        final Object bindingVal = searchVals.get(tableAttrName);
                        if (!new EqualsBuilder().append(rowVal,
                                                        bindingVal).isEquals()) { // Difference found, we stop the compare.
                            isLookup = false;
                            break;
View Full Code Here

Examples of oracle.kv.table.Row

    protected void onPersist(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders)
    {
        KunderaCoreUtils.printQuery(
                "Persist data into " + entityMetadata.getSchema() + "." + entityMetadata.getTableName() + " for " + id,
                showQuery);
        Row row = createRow(entityMetadata, entity, id, rlHolders);
        // TODO:: handle case for putDate??????

        tableAPI.put(row, null, null);
    }
View Full Code Here

Examples of org.adbcj.Row

     
      Assert.assertEquals(6, resultSet.size());
     
      Iterator<Row> i = resultSet.iterator();
     
      Row nullRow = null;
      Row row = i.next();
      if (row.get(0).isNull()) {
        nullRow = row;
        row = i.next();
      }
      Assert.assertEquals(row.get(0).getInt(), 0);
      Assert.assertEquals(row.get(1).getValue(), "Zero");
      row = i.next();
      Assert.assertEquals(row.get(0).getInt(), 1);
      Assert.assertEquals(row.get(1).getValue(), "One");
      row = i.next();
      Assert.assertEquals(row.get(0).getInt(), 2);
      Assert.assertEquals(row.get(1).getValue(), "Two");
      row = i.next();
      Assert.assertEquals(row.get(0).getInt(), 3);
      Assert.assertEquals(row.get(1).getValue(), "Three");
      row = i.next();
      Assert.assertEquals(row.get(0).getInt(), 4);
      Assert.assertEquals(row.get(1).getValue(), "Four");
 
      if (i.hasNext() && nullRow == null) {
        nullRow = i.next();
      }
     
View Full Code Here

Examples of org.apache.blur.thrift.generated.Row

    record.setColumns(Arrays.asList(columns));
    return record;
  }

  public static Row newRow(String rowId, Record... records) {
    Row row = new Row().setId(rowId);
    for (Record record : records) {
      row.addToRecords(record);
    }
    return row;
  }
View Full Code Here

Examples of org.apache.cassandra.db.Row

        List<Row> rows = CassandraUtils.robustRead(keyKey, new QueryPath(CassandraUtils.schemaInfoColumnFamily),
                Arrays.asList(keyCol), ConsistencyLevel.QUORUM);

        if (rows.size() == 1)
        {
            Row row = rows.get(0);

            if (row.cf != null)
            {
                IColumn col = row.cf.getColumn(keyCol);
View Full Code Here

Examples of org.apache.cassandra.stress.generate.Row

        return getColumnValues(new ColumnSelection(null, 0, settings.columns.names.size()));
    }

    protected List<ByteBuffer> getColumnValues(ColumnSelection columns)
    {
        Row row = partitions.get(0).iterator(1, false).next().iterator().next();
        ByteBuffer[] r = new ByteBuffer[columns.count()];
        int c = 0;
        if (columns.indices != null)
            for (int i : columns.indices)
                r[c++] = (ByteBuffer) row.get(i);
        else
            for (int i = columns.lb ; i < columns.ub ; i++)
                r[c++] = (ByteBuffer) row.get(i);
        return Arrays.asList(r);
    }
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.