@Override public boolean persist(List listEntity, EntityMetadata m, SparkClient sparkClient) { throw new KunderaException("Entity persistence in teradata is currently not supported. "); }
@Override public void saveDataFrame(DataFrame dataFrame, Class<?> entityClazz, Map<String, Object> properties) { throw new KunderaException("Dataframe persistence in teradata is currently not supported. "); }
@Override public void saveDataFrame(DataFrame dataFrame, Class<?> entityClazz, Map<String, Object> properties) { throw new KunderaException("Saving data of DataFrame back to MongoDB is currently not supported. "); }
@Override public Map<String, Object> search(KunderaMetadata kunderaMetadata, KunderaQuery kunderaQuery, PersistenceDelegator persistenceDelegator, EntityMetadata m, int firstResult, int maxResults) { throw new KunderaException("Unsupported Method"); } }
@Override public Map<String, Object> search(KunderaMetadata kunderaMetadata, KunderaQuery kunderaQuery, PersistenceDelegator persistenceDelegator, EntityMetadata m, int firstResult, int maxResults) { throw new KunderaException("Unsupported Method"); } }
@Override protected List recursivelyPopulateEntities(EntityMetadata m, Client client) { throw new KunderaException("Query on entities having relations is currently not supported in kundera-spark."); }
public List executeQuery(Class clazz, List<String> relationalField, boolean isNative, String cqlQuery, final List<KunderaQuery.BindParameter> parameters) { throw new KunderaException("not implemented"); }
/** * Builds the index name. * * @param bucketName * the bucket name * @return the string */ private String buildIndexName(String bucketName) { if (bucketName == null) { throw new KunderaException("Bucket Name can't be null!"); } return (bucketName + CouchbaseConstants.INDEX_SUFFIX).toLowerCase(); }
@Override public String getInputFilePath(Map<String, Object> properties) { String path = (String) properties.get(SparkPropertiesConstants.HDFS_INPUT_FILE_PATH); if (path == null || path.isEmpty()) { throw new KunderaException( "Please set the path of inputfile while creating EntityManager using the property" + "\"" + SparkPropertiesConstants.HDFS_INPUT_FILE_PATH + "\"."); } return path; }
@Override public String getOutputFilePath(Map<String, Object> properties) { String path = (String) properties.get(SparkPropertiesConstants.HDFS_OUTPUT_FILE_PATH); if (path == null || path.isEmpty()) { throw new KunderaException( "Please set the path of outputfile while creating EntityManager using the property" + "\"" + SparkPropertiesConstants.HDFS_OUTPUT_FILE_PATH + "\"."); } return path; }
/** * Gets the valid Id type. * * @param type * the type * @return the valid Id type */ public static String getValidIdType(String type) { if(validationClassMapperforId.get(type) == null){ throw new KunderaException("ID of type: "+type+" is not supported for Kundera Oracle NOSQL."); } return validationClassMapperforId.get(type); } }
private void onPostEvent(EntityMetadata metadata, EntityEvent event) { try { this.eventDispatcher.fireEventListeners(metadata, this.data, EntityEvent.getPostEvent(event)); } catch (Exception es) { throw new KunderaException(es); } }
private void onPreEvent(EntityMetadata metadata, EntityEvent event) { try { this.eventDispatcher.fireEventListeners(metadata, this.data, EntityEvent.getPreEvent(event)); } catch (Exception es) { throw new KunderaException(es); } }
private void checkMultipleLobs(TableInfo tableInfo) { if (tableInfo.getLobColumnInfo().size() > 1) throw new KunderaException("Multiple Lob fields in a single Entity are not supported in Kundera"); }
/** * * @return pool an the basis of LoadBalancing policy. */ private IThriftPool getPoolUsingPolicy() { if (!hostPools.isEmpty()) { logger.info("Returning pool using {} .", loadBalancingPolicy.getClass().getSimpleName()); return (IThriftPool) loadBalancingPolicy.getPool(hostPools.values()); } throw new KunderaException("All hosts are down. please check servers manully."); }
/** * Gets the pool using policy. * * @return pool an the basis of LoadBalancing policy. */ private ConnectionPool getPoolUsingPolicy() { if (!hostPools.isEmpty()) { return (ConnectionPool) loadBalancingPolicy.getPool(hostPools.values()); } throw new KunderaException("All hosts are down. please check servers manully."); }
@Override protected Object createPoolOrConnection() { try { this.connection = ConnectionFactory.createConnection(conf); return connection; } catch (IOException e) { logger.error("Connection could not be established", e); throw new KunderaException("Connection could not be established", e); } }
private void createUniqueIndexGFS(DBCollection coll, String id) { try { coll.createIndex(new BasicDBObject("metadata." + id, 1), new BasicDBObject("unique", true)); } catch (MongoException ex) { throw new KunderaException("Error in creating unique indexes in " + coll.getFullName() + " collection on " + id + " field"); } }
public List<T> query(String query, QueryType type) { switch (type) { case JPQL: return query(query); case NATIVE: return nativeQuery(query); default: throw new KunderaException("invalid query type"); } }
@Override public <T> T execute(final String query, Object connection) { Session session = factory.getConnection(); try { Statement queryStmt = new SimpleStatement(query); KunderaCoreUtils.printQuery(query, showQuery); queryStmt.setConsistencyLevel(ConsistencyLevel.valueOf(this.consistencyLevel.name())); return (T) session.execute(queryStmt); } catch (Exception e) { log.error("Error while executing query {}.", query); throw new KunderaException(e); } finally { // factory.releaseConnection(session); } }