Search in sources :

Example 1 with NotImplementedException

use of org.apache.commons.lang.NotImplementedException in project hbase by apache.

the class FSTableDescriptors method deleteTableDescriptorIfExists.

/**
   * Deletes all the table descriptor files from the file system.
   * Used in unit tests only.
   * @throws NotImplementedException if in read only mode
   */
public void deleteTableDescriptorIfExists(TableName tableName) throws IOException {
    if (fsreadonly) {
        throw new NotImplementedException("Cannot delete a table descriptor - in read only mode");
    }
    Path tableDir = getTableDir(tableName);
    Path tableInfoDir = new Path(tableDir, TABLEINFO_DIR);
    deleteTableDescriptorFiles(fs, tableInfoDir, Integer.MAX_VALUE);
}
Also used : Path(org.apache.hadoop.fs.Path) NotImplementedException(org.apache.commons.lang.NotImplementedException)

Example 2 with NotImplementedException

use of org.apache.commons.lang.NotImplementedException in project hbase by apache.

the class FSTableDescriptors method updateTableDescriptor.

/**
   * Update table descriptor on the file system
   * @throws IOException Thrown if failed update.
   * @throws NotImplementedException if in read only mode
   */
@VisibleForTesting
Path updateTableDescriptor(HTableDescriptor td) throws IOException {
    if (fsreadonly) {
        throw new NotImplementedException("Cannot update a table descriptor - in read only mode");
    }
    TableName tableName = td.getTableName();
    Path tableDir = getTableDir(tableName);
    Path p = writeTableDescriptor(fs, td, tableDir, getTableInfoPath(tableDir));
    if (p == null)
        throw new IOException("Failed update");
    LOG.info("Updated tableinfo=" + p);
    if (usecache) {
        this.cache.put(td.getTableName(), td);
    }
    return p;
}
Also used : Path(org.apache.hadoop.fs.Path) TableName(org.apache.hadoop.hbase.TableName) NotImplementedException(org.apache.commons.lang.NotImplementedException) IOException(java.io.IOException) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 3 with NotImplementedException

use of org.apache.commons.lang.NotImplementedException in project openhab1-addons by openhab.

the class TestCaseSupport method startServer.

private void startServer() throws UnknownHostException, InterruptedException {
    spi = new SimpleProcessImage();
    ModbusCoupler.getReference().setProcessImage(spi);
    ModbusCoupler.getReference().setMaster(false);
    ModbusCoupler.getReference().setUnitID(SLAVE_UNIT_ID);
    if (ServerType.TCP.equals(serverType)) {
        startTCPServer();
    } else if (ServerType.UDP.equals(serverType)) {
        startUDPServer();
    } else if (ServerType.SERIAL.equals(serverType)) {
        startSerialServer();
    } else {
        throw new NotImplementedException();
    }
}
Also used : NotImplementedException(org.apache.commons.lang.NotImplementedException) SimpleProcessImage(net.wimpi.modbus.procimg.SimpleProcessImage)

Example 4 with NotImplementedException

use of org.apache.commons.lang.NotImplementedException in project intellij-elixir by KronicDeth.

the class ElixirPsiImplUtil method quotedChildNodes.

private static OtpErlangObject quotedChildNodes(@NotNull Parent parent, @NotNull OtpErlangList metadata, @NotNull ASTNode... children) {
    OtpErlangObject quoted;
    final int childCount = children.length;
    if (childCount == 0) {
        quoted = parent.quoteEmpty();
    } else {
        List<OtpErlangObject> quotedParentList = new LinkedList<OtpErlangObject>();
        List<Integer> codePointList = null;
        for (ASTNode child : children) {
            IElementType elementType = child.getElementType();
            if (elementType == parent.getFragmentType()) {
                codePointList = parent.addFragmentCodePoints(codePointList, child);
            } else if (elementType == ElixirTypes.ESCAPED_CHARACTER) {
                codePointList = parent.addEscapedCharacterCodePoints(codePointList, child);
            } else if (elementType == ElixirTypes.ESCAPED_EOL) {
                codePointList = parent.addEscapedEOL(codePointList, child);
            } else if (elementType == ElixirTypes.HEXADECIMAL_ESCAPE_PREFIX) {
                codePointList = addChildTextCodePoints(codePointList, child);
            } else if (elementType == ElixirTypes.INTERPOLATION) {
                if (codePointList != null) {
                    quotedParentList.add(elixirString(codePointList));
                    codePointList = null;
                }
                ElixirInterpolation childElement = (ElixirInterpolation) child.getPsi();
                quotedParentList.add(childElement.quote());
            } else if (elementType == ElixirTypes.QUOTE_HEXADECIMAL_ESCAPE_SEQUENCE || elementType == ElixirTypes.SIGIL_HEXADECIMAL_ESCAPE_SEQUENCE) {
                codePointList = parent.addHexadecimalEscapeSequenceCodePoints(codePointList, child);
            } else {
                throw new NotImplementedException("Can't quote " + child);
            }
        }
        if (codePointList != null && quotedParentList.isEmpty()) {
            quoted = parent.quoteLiteral(codePointList);
        } else {
            if (codePointList != null) {
                quotedParentList.add(elixirString(codePointList));
            }
            OtpErlangObject[] quotedStringElements = new OtpErlangObject[quotedParentList.size()];
            quotedParentList.toArray(quotedStringElements);
            OtpErlangTuple binaryConstruction = quotedFunctionCall("<<>>", metadata, quotedStringElements);
            quoted = parent.quoteBinary(binaryConstruction);
        }
    }
    return quoted;
}
Also used : BigInteger(java.math.BigInteger) IElementType(com.intellij.psi.tree.IElementType) NotImplementedException(org.apache.commons.lang.NotImplementedException) ASTNode(com.intellij.lang.ASTNode)

Example 5 with NotImplementedException

use of org.apache.commons.lang.NotImplementedException in project intellij-elixir by KronicDeth.

the class ElixirPsiImplUtil method quote.

@Contract(pure = true)
@NotNull
public static OtpErlangObject quote(@NotNull final ElixirCharToken charToken) {
    ASTNode[] children = charToken.getNode().getChildren(null);
    if (children.length != 2) {
        throw new NotImplementedException("CharToken expected to be ?(<character>|<escape sequence>)");
    }
    final ASTNode tokenized = children[1];
    IElementType tokenizedElementType = tokenized.getElementType();
    int codePoint;
    if (tokenizedElementType == ElixirTypes.CHAR_LIST_FRAGMENT) {
        if (tokenized.getTextLength() != 1) {
            throw new NotImplementedException("Tokenized character expected to only be one character long");
        }
        String tokenizedString = tokenized.getText();
        codePoint = tokenizedString.codePointAt(0);
    } else {
        EscapeSequence escapeSequence = (EscapeSequence) tokenized.getPsi();
        codePoint = escapeSequence.codePoint();
    }
    return new OtpErlangLong(codePoint);
}
Also used : IElementType(com.intellij.psi.tree.IElementType) NotImplementedException(org.apache.commons.lang.NotImplementedException) ASTNode(com.intellij.lang.ASTNode) Contract(org.jetbrains.annotations.Contract) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

NotImplementedException (org.apache.commons.lang.NotImplementedException)36 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 List (java.util.List)4 Path (org.apache.hadoop.fs.Path)4 ASTNode (com.intellij.lang.ASTNode)3 IElementType (com.intellij.psi.tree.IElementType)3 File (java.io.File)3 Collection (java.util.Collection)3 LinkedList (java.util.LinkedList)3 Map (java.util.Map)3 Entry (java.util.Map.Entry)3 NotNull (org.jetbrains.annotations.NotNull)3 LeafPsiElement (com.intellij.psi.impl.source.tree.LeafPsiElement)2 TableName (org.apache.hadoop.hbase.TableName)2 DMLProgram (org.apache.sysml.parser.DMLProgram)2 XSDConstrainingFacet (org.eclipse.xsd.XSDConstrainingFacet)2 XSDSimpleTypeDefinition (org.eclipse.xsd.XSDSimpleTypeDefinition)2 Contract (org.jetbrains.annotations.Contract)2