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);
}
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;
}
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();
}
}
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;
}
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);
}
Aggregations