Package com.inadco.hbl.client

Examples of com.inadco.hbl.client.HblException


        int month = 0;
        int date = 0;

        switch (depth) {
        case 0:
            throw new HblException(
                "Unable to make a presentation of an [ALL] hierarchy member in terms of concrete calendar.");
        case 1:
            year = HblUtil.readCompositeKeyDec(buff, offset, 4);
            month = HblUtil.readCompositeKeyDec(buff, offset + 4, 2) - Calendar.JANUARY + 1;
            date = HblUtil.readCompositeKeyDec(buff, offset + 6, 2);
            break;
        default:
            throw new HblException("unexpected hierarchy depth in the key.");
        }
        // we return stuff as calendar objects here.
        GregorianCalendar gc = new GregorianCalendar(UTC);
        gc.set(Calendar.YEAR, year);
        gc.set(Calendar.MONTH, month);
View Full Code Here


                                   dimName2GroupKeyOffsetMap,
                                   null,
                                   null,
                                   null);
        } catch (IOException exc) {
            throw new HblException(exc.getMessage(), exc);
        } finally {
            reset();
        }
    }
View Full Code Here

                                   dimName2GroupKeyOffsetMap,
                                   startSplitKey,
                                   endSplitKey,
                                   enforcedCuboidTableName);
        } catch (IOException exc) {
            throw new HblException(exc.getMessage(), exc);
        } finally {
            reset();
        }

    }
View Full Code Here

    @Override
    public Object getAggregate(String measure, String functionName) throws HblException {
        try {
            Integer index = measureName2IndexMap.get(measure);
            if (index == null)
                throw new HblException(String.format("Invalid measure name:%s.", measure));
            AggregateFunction af = afr.findFunction(functionName);
            if (af == null)
                throw new HblException(String.format("Invalid function name:%s.", functionName));
            if (result == null)
                throw new HblException("no current result");
            Aggregation measureAggr = result[index];
            if (measureAggr == null) {
                Aggregation.Builder b = delegate.current().getMeasures()[index];
                result[index] = b == null ? null : (measureAggr = b.build()); // cache
            }

            return af.getAggrValue(measureAggr);
        } catch (IOException exc) {
            throw new HblException(exc.getMessage(), exc);
        }

    }
View Full Code Here

    }

    @Override
    public Object getGroupMember(String dimensionName) throws HblException {
        if (result == null)
            throw new HblException("no current result");
        try {
            Integer offset = dim2GroupKeyOffsetMap.get(dimensionName);
            if (offset == null)
                throw new HblException(String.format("Dimension '%s' is not part of the group.", dimensionName));

            byte[] group = delegate.current().getGroup();
            Dimension dim = groupDimName2Dimension.get(dimensionName);
            Validate.notNull(dim);

            return dim.getMember(group, offset);
        } catch (IOException exc) {
            throw new HblException(exc.getMessage(), exc);
        }

    }
View Full Code Here

        int date = 0;
        int hour = 0;

        switch (depth) {
        case 0:
            throw new HblException(
                "Unable to make a presentation of an [ALL] hierarchy member in terms of concrete calendar.");
        case 2:
            date = HblUtil.readCompositeKeyDec(buff, offset + 6, 2);
            hour = HblUtil.readCompositeKeyDec(buff, offset + 8, 2);
        case 1:
            year = HblUtil.readCompositeKeyDec(buff, offset, 4);
            month = HblUtil.readCompositeKeyDec(buff, offset + 4, 2) - Calendar.JANUARY + 1;
            break;
        default:
            throw new HblException("unexpected hierarchy depth in the key.");
        }
        // we return stuff as calendar objects here.
        GregorianCalendar gc = new GregorianCalendar(UTC);
        gc.set(Calendar.YEAR, year);
        gc.set(Calendar.MONTH, month);
View Full Code Here

                    PreparedAggregateQueryImpl paq = (PreparedAggregateQueryImpl) hblQueryClient.createPreparedQuery();
                    paq.prepare(getHblQuery(conf));

                    String cuboidTableName = hblSplit.getCuboidTable();
                    if (cuboidTableName == null)
                        throw new HblException("Invalid cuboid name at backend. Something in MR happened wrong.");

                    int paramNo = getParamNo(conf);
                    for (int i = 0; i < paramNo; i++)
                        paq.setHblParameter(i, getParamNo(conf));
View Full Code Here

        try {
            HBLQueryASTParser.select_return r = parser.select();
            selectAST = (Tree) r.getTree();
            // if (parser.getNumberOfSyntaxErrors() > 0)
            if (errors.getErrors().size() > 0) {
                throw new HblException(errors.formatErrors());
            }

        } catch (RecognitionException exc) {
            throw new HblException(exc.getMessage());
        }

    }
View Full Code Here

        }

        try {
            prepper.select();
            if (prepperErrors.getErrors().size() > 0)
                throw new HblException(prepperErrors.formatErrors());
        } catch (RecognitionException exc) {
            throw new HblException(exc.getMessage(), exc);
        }

    }
View Full Code Here

TOP

Related Classes of com.inadco.hbl.client.HblException

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.