nosql

How do I retrieve table names in Cassandra using Java?

孤人 提交于 2019-12-10 13:22:19
问题 If is use this code in a CQL shell , I get all the names of table(s) in that keyspace. DESCRIBE TABLES; I want to retrieve the same data using ResulSet . Below is my code in Java. String query = "DESCRIBE TABLES;"; ResultSet rs = session.execute(query); for(Row row : rs) { System.out.println(row); } While session and cluster has been initialized earlier as: Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build(); Session session = cluster.connect("keyspace_name"); Or I like

Couchbase connection timeout with Java SDK

谁说胖子不能爱 提交于 2019-12-10 13:15:22
问题 I followed the couchbase tutorial to connect to remote couchbase server, but it failed on connection time out after I try to open default bucket. I have checked that I can open couchbase server page on my computer(192.xx.xx.xx:8091) Here is my Java code CouchbaseEnvironment env = DefaultCouchbaseEnvironment.builder() .queryEnabled(true) .build(); Cluster cluster = CouchbaseCluster.create(env,"192.xx.xx.xx:8091"); Bucket bucket = cluster.openBucket("default",""); JsonObject user = JsonObject

Is it possible to constraint edge multiplicity in Neo4j / OrientDB?

妖精的绣舞 提交于 2019-12-10 13:09:59
问题 I was wondering whether Neo4j and OrientDB provide the possibility of defining constraints in terms of multiplicity for specific edge types? 回答1: For OrientDB You can set multiplicity on out/in collection per label. Example to set maximum 1 edges from Person to Company if the edge's label is "workFor": ALTER PROPERTY Person.out_workFor NOT NULL ALTER PROPERTY Person.out_workFor MAX 1 You can also set the minimum with: ALTER PROPERTY Person.out_workFor MIN 1 In this way with min & max it's

Cross-platform embedded database/key-value store for C#

五迷三道 提交于 2019-12-10 12:56:42
问题 I'm looking for a fast, embeddable key/value store with cursor semantics over key collections (or a simple embeddable DB) that I can use in .NET and mono. Need it to be open-source, would prefer an MIT or Apache style license over a GPL license. Not opposed to a library that needs bindings to be written, as long as binaries are available for both windows and linux. Options considered: SQLite - has bindings and native implementation, but single-threaded and not all that fast Embedded InnoDB -

MongoDB + Web App: Database per user

拟墨画扇 提交于 2019-12-10 12:55:44
问题 I'm in the process of evaluating MongoDB for a personal project. I'm putting together a site that will allow users to register and store information on my server. While evaluating MongoDB I saw that it can create a database on the fly, the first time a record is inserted. That got me thinking that I could separate the data for each user into their own database. The database name will be derived from the user's unique id. After a user registers, the first time they store information their

How scalable are automatic secondary indexes in Cassandra 0.7?

徘徊边缘 提交于 2019-12-10 12:54:47
问题 As far as I understand automatic secondary indexes are generated for node local data. In this case query by secondary index involve all nodes storing part of column family to get results (?) so (if i am right) if data is spread across 50 nodes then 50 nodes are involved in single query? How far can this scale? Is this more scalable than manual secondary indexes (inverted index column family)? Few nodes or hundred nodes? 回答1: See Stu's answer from the ml http://www.mail-archive.com/user

count number of rows in cloudant in response

梦想的初衷 提交于 2019-12-10 12:17:11
问题 I have below response from my map reduce . Now i want to count the number of rows in the response can any one help me how i can do it in cloudant? I need something in response like to get the total count of distinct correlationid in a period. { rows: [ { key: [ "201705", "aws-60826346-" ], value: null }, { key: [ "201705", "aws-60826348802-" ], value: null }, { key: [ "201705", "aws-las97628elb" ], value: null }, { key: [ "201705", "aws-ve-test" ], value: null }, { key: [ "201705", "aws

Handling quorum writies fail on Cassandra

时光毁灭记忆、已成空白 提交于 2019-12-10 12:09:25
问题 According to Datastax documentation about atomicity in Cassandra: QUORUM write succeeded only on one node will not be rolled back (Check Atomicity chapter there:http://www.datastax.com/documentation/cassandra/1.2/webhelp/index.html#cassandra/dml/dml_about_transactions_c.html). So when I am performing a QUORUM write on cluster with RF=3 and one node fails, I will get write error status and one successful write on another node. This produces two cases: write will be propagated to other nodes

mongodb count vs find with count [duplicate]

左心房为你撑大大i 提交于 2019-12-10 11:55:13
问题 This question already has answers here : Difference between count() and find().count() in MongoDB (5 answers) Closed 2 years ago . I am performing a count of documents in a mongo (versions 2.4 and 3.2) collection. The collection is very big, 3821085 documents. I need to count all documents with a reference _id . I have tried two different queries: db.SampleCollection.find({"field._id" : ObjectId("UUID")}).count() db.SampleCollection.count({"field._id" : ObjectId("UUID")}) This query takes a

Deleting Columns in HBase

不羁的心 提交于 2019-12-10 11:53:09
问题 In HBase, calling DeleteColumn() method i.e., essentially a schema change to a column family or deleting column families will result in downtime of HBase Cluster? 回答1: The deleteColumn method on a Delete mutation of HBase deletes specific column(s) from a specific row this is not a schema change since HBase does not retain a schema-level knowledge of columns of each row (and each row can have a different number and types of columns - think about it as a thinly populated matrix). The same is