All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bigdata.relation.rule.eval.ChunkTrace Maven / Gradle / Ivy

/*

Copyright (C) SYSTAP, LLC DBA Blazegraph 2006-2016.  All rights reserved.

Contact:
     SYSTAP, LLC DBA Blazegraph
     2501 Calvert ST NW #106
     Washington, DC 20008
     [email protected]

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/
/*
 * Created on Oct 29, 2008
 */

package com.bigdata.relation.rule.eval;

import com.bigdata.relation.rule.eval.pipeline.JoinMasterTask;
import com.bigdata.relation.rule.eval.pipeline.JoinTask;

/**
 * Utility class that may be used to trace the chunks accepted for join
 * processing for each predicate. The output has the form
 * 
 * 
 * n[m]
 * 
* * where n is the evaluation order of the predicate and * m is the #of elements in the chunk. * * @author Bryan Thompson * @version $Id$ */ public class ChunkTrace { /** * Zero to enable the {@link System#err} trace of chunks accepted for each * join dimension -or- -1 to disable. This field is the * column count of the output and is used to wrap the output so as to not * cause eclipse undue distress with long lines. *

* Note: This is static so that it will count for all concurrent * {@link JoinTask} for some {@link JoinMasterTask}, at least those running * in the same JVM. */ protected static int col = -1; static final public void chunk(final int orderIndex, final Object[] chunk) { if (col >= 0) { final String s = Integer.toString(orderIndex) + "[" + Integer.toString(chunk.length) + "]"; System.err.print(s); col = col + s.length() > 80 ? 0 : col + s.length(); if (col == 0) { System.err.print("\n"); } } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy