use of org.apache.commons.lang.NotImplementedException in project intellij-elixir by KronicDeth.
the class Resolvable method resolvable.
@NotNull
private static Resolvable resolvable(@NotNull Parent parent, @NotNull ASTNode[] children) {
Resolvable resolvable;
if (children.length == 0) {
resolvable = new Exact(":\"\"");
} else {
List<String> regexList = new LinkedList<>();
List<Integer> codePointList = null;
for (ASTNode child : children) {
IElementType elementType = child.getElementType();
if (elementType == ElixirTypes.FRAGMENT) {
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) {
regexList.add(codePointListToString(codePointList));
codePointList = null;
}
regexList.add(interpolation());
} 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 convert to Resolvable " + child);
}
}
if (codePointList != null && regexList.isEmpty()) {
resolvable = resolvableLiteral(codePointList);
} else {
if (codePointList != null) {
regexList.add(codePointListToRegex(codePointList));
}
resolvable = new Pattern(join(regexList));
}
}
return resolvable;
}
use of org.apache.commons.lang.NotImplementedException in project h2o-2 by h2oai.
the class Tree method getNumLeaves.
public static int getNumLeaves(AutoBuffer ab, int leftSize, boolean regression) {
int result = 0;
int startPos = ab.position();
while (ab.position() < startPos + leftSize) {
byte currentNodeType = (byte) ab.get1();
if (currentNodeType == 'S' || currentNodeType == 'E') {
// skip col and split value.
ab.get2();
// skip col and split value.
ab.get4f();
int skipSize = ab.get1();
if (skipSize == 0) {
ab.get3();
}
} else if (currentNodeType == '[') {
result++;
if (regression)
ab.get4f();
else
ab.get1();
} else {
throw new NotImplementedException();
}
}
// return to the original position so the buffer seems untouched.
ab.position(startPos);
return result;
}
use of org.apache.commons.lang.NotImplementedException in project hbase by apache.
the class FSTableDescriptors method add.
/**
* Adds (or updates) the table descriptor to the FileSystem
* and updates the local cache with it.
*/
@Override
public void add(HTableDescriptor htd) throws IOException {
if (fsreadonly) {
throw new NotImplementedException("Cannot add a table descriptor - in read only mode");
}
TableName tableName = htd.getTableName();
if (TableName.META_TABLE_NAME.equals(tableName)) {
throw new NotImplementedException();
}
if (HConstants.HBASE_NON_USER_TABLE_DIRS.contains(tableName.getNameAsString())) {
throw new NotImplementedException("Cannot add a table descriptor for a reserved subdirectory name: " + htd.getNameAsString());
}
updateTableDescriptor(htd);
}
use of org.apache.commons.lang.NotImplementedException in project hbase by apache.
the class FSTableDescriptors method createTableDescriptorForTableDirectory.
/**
* Create a new HTableDescriptor in HDFS in the specified table directory. Happens when we create
* a new table or snapshot a table.
* @param tableDir table directory under which we should write the file
* @param htd description of the table to write
* @param forceCreation if <tt>true</tt>,then even if previous table descriptor is present it will
* be overwritten
* @return <tt>true</tt> if the we successfully created the file, <tt>false</tt> if the file
* already exists and we weren't forcing the descriptor creation.
* @throws IOException if a filesystem error occurs
*/
public boolean createTableDescriptorForTableDirectory(Path tableDir, HTableDescriptor htd, boolean forceCreation) throws IOException {
if (fsreadonly) {
throw new NotImplementedException("Cannot create a table descriptor - in read only mode");
}
FileStatus status = getTableInfoPath(fs, tableDir);
if (status != null) {
LOG.debug("Current tableInfoPath = " + status.getPath());
if (!forceCreation) {
if (fs.exists(status.getPath()) && status.getLen() > 0) {
if (readTableDescriptor(fs, status).equals(htd)) {
LOG.debug("TableInfo already exists.. Skipping creation");
return false;
}
}
}
}
Path p = writeTableDescriptor(fs, htd, tableDir, status);
return p != null;
}
use of org.apache.commons.lang.NotImplementedException in project openhab1-addons by openhab.
the class BaseIntegrationTest method initService.
@BeforeClass
public static void initService() throws InterruptedException {
items.put("dimmer", new DimmerItem("dimmer"));
items.put("number", new NumberItem("number"));
items.put("string", new StringItem("string"));
items.put("switch", new SwitchItem("switch"));
items.put("contact", new ContactItem("contact"));
items.put("color", new ColorItem("color"));
items.put("rollershutter", new RollershutterItem("rollershutter"));
items.put("datetime", new DateTimeItem("datetime"));
items.put("call", new CallItem("call"));
items.put("location", new LocationItem("location"));
service = new DynamoDBPersistenceService();
service.setItemRegistry(new ItemRegistry() {
@Override
public void removeItemRegistryChangeListener(ItemRegistryChangeListener listener) {
throw new NotImplementedException();
}
@Override
public boolean isValidItemName(String itemName) {
throw new NotImplementedException();
}
@Override
public Collection<Item> getItems(String pattern) {
throw new NotImplementedException();
}
@Override
public Collection<Item> getItems() {
throw new NotImplementedException();
}
@Override
public Item getItemByPattern(String name) throws ItemNotFoundException, ItemNotUniqueException {
throw new NotImplementedException();
}
@Override
public Item getItem(String name) throws ItemNotFoundException {
Item item = items.get(name);
if (item == null) {
throw new ItemNotFoundException(name);
}
return item;
}
@Override
public void addItemRegistryChangeListener(ItemRegistryChangeListener listener) {
throw new NotImplementedException();
}
});
HashMap<String, Object> config = new HashMap<>();
config.put("region", System.getProperty("DYNAMODBTEST_REGION"));
config.put("accessKey", System.getProperty("DYNAMODBTEST_ACCESS"));
config.put("secretKey", System.getProperty("DYNAMODBTEST_SECRET"));
config.put("tablePrefix", "dynamodb-integration-tests-");
for (Entry<String, Object> entry : config.entrySet()) {
if (entry.getValue() == null) {
logger.warn(String.format("Expecting %s to have value for integration tests. Integration tests will be skipped", entry.getKey()));
service = null;
return;
}
}
service.activate(null, config);
// Clear data
for (String table : new String[] { "dynamodb-integration-tests-bigdecimal", "dynamodb-integration-tests-string" }) {
try {
service.getDb().getDynamoClient().deleteTable(table);
service.getDb().getDynamoDB().getTable(table).waitForDelete();
} catch (ResourceNotFoundException e) {
}
}
}
Aggregations