aerospike

aerospike: delete all record in a set

守給你的承諾、 提交于 2020-04-13 17:10:19
问题 I am using aerospike for testing. I am using community edition.The cluster has 2 nodes. I am using storage engine as device with SSD. My config file - namespace test { replication-factor 2 memory-size 16G default-ttl 0 storage-engine device { device /dev/sdb1 data-in-memory false write-block-size 128K } } I have set named data . After adding 1M record in it for testing ,now i want to delete everything in this set (if possible drop set too). I tried this command on both node- asinfo -v "set

Why are Reads/sec very less in aerospike then as compared to Write/sec?

我与影子孤独终老i 提交于 2020-02-06 07:56:13
问题 I am using aerospike v4.8 and i am making read and write requests to aerospike where in my write request i am getting a throughput of 4000 writes/sec whereas in reads the throughput is only 10-15 reads/sec which is very low. My query is: let query = aerospikeClient.query(nameSpace, set) query.select('count', 'targetKey') query.predexp = [ predexp.stringBin('campaignKey'), predexp.stringValue(Id1 + ':' + Id2 + ':' + Id3 + ':' + channel), predexp.stringEqual(), predexp.integerBin('epochDay'),

Google App Engine fails to connect Aerospike installed on Google Compute Engine

醉酒当歌 提交于 2020-01-16 01:53:07
问题 I'm trying to connect my GAE Application to Aerospike installed on Google Compute Engine. Code snippet below is ok if i use main function. public static void main(String[] args) { AerospikeClient client = new AerospikeClient("xxx.xxx.xx.xx", 3000); boolean isConnect = client.isConnected(); Key key = new Key("test", "demo", "putgetkey"); Bin bin1 = new Bin("bin1", "value1"); Bin bin2 = new Bin("bin2", "value2"); client.put(null, key, bin1, bin2); Record record = client.get(null, key); client

drop and trim a list in aerospike udf

ⅰ亾dé卋堺 提交于 2020-01-14 03:50:11
问题 I try to drop and trim a list to build a pagination system local function createMap(postId, paramDate) local m = map { id = postId, date = paramDate }; return m; end function get(rec, binName, from, to) if aerospike:exists(rec) then local l = rec[binName] if (l == nil) then return nil else local length = #l; if (length <= 10 and to <=10) then return l; elseif (to >= length) then local drop = list.drop(l, from); return drop; else list.trim(l, to);--Remove all elements at and beyond a specified

How to parse aerospike backup file to regenerate data?

余生长醉 提交于 2020-01-03 19:42:35
问题 In the backup file there are a lot of encoded values. How do I get back the original data. For example there is + d q+LsiGs1gD9duJDbzQSXytajtCY= which is of the format ["+"] [SP] ["d"] [SP] [{digest}] [LF] where q+LsiGs1gD9duJDbzQSXytajtCY= is the key digest. How would the get the primary key from this? Also Map and List values are represented as opaque byte values. How do we restore the original Map and List? I would currently need to do all this if I wanted to make a CSV dump out of the

Aerospike Timeout Exception

ⅰ亾dé卋堺 提交于 2020-01-02 10:44:06
问题 I have an application that users a lot of batch reads in Aerospike. After some time the application is running, I get a lot these errors: play.api.Application$$anon$1: Execution exception[[AerospikeException: Error Code 9: Timeout]] at play.api.Application$class.handleError(Application.scala:296) ~[com.typesafe.play.play_2.11-2.3.7.jar:2.3.7] at play.api.DefaultApplication.handleError(Application.scala:402) [com.typesafe.play.play_2.11-2.3.7.jar:2.3.7] at play.core.server.netty

sort an array of associatives arrays in lua

心已入冬 提交于 2019-12-24 17:25:33
问题 I have an array that have this structure : [{"value":{"date":"2015-12-27T16:02:38.109Z", "read":"no"}, "key":"56800b9e9669ef7312d94f4c"}, {"value":{"date":"2015-12-30T13:01:30.580Z", "read":"no"}, "key":"5683d5aaec6a8c2428ca1011"},...] I want to sort this array by date in descending order with pagination. I tried this for example where wholeList is the name of the array and if want to return from indice 1 to 9: local function compare(a,b) return os.date(b["date"]) < os.date(a["date"]) end

How to modify the TTL of all records set with a ttl of -1 in aerospike?

浪尽此生 提交于 2019-12-23 22:03:06
问题 I want to modify the TTL of all the records that were accidentally set with a 'never expire' TTL (-1 in the client). How would I do that? 回答1: Just to clarify, setting a TTL of -1 in the client means never expire (equivalent to a default-ttl of 0 in the server's aerospike.conf file), while setting a TTL of 0 in the client means inherit the default-ttl for this namespace . With Predicate Filtering: If you're using the Java, C, C# and Go clients the easiest way to identify the records with a

What are the use cases where Redis is preferred to Aerospike?

大城市里の小女人 提交于 2019-12-23 12:12:18
问题 We are currently using Redis and it's a great in-memory datastore. We're starting to look at some new problems where the in-memory limitation is a factor and looking at other option. One we came across is Aerospike - it seems very fast, even faster than redis on in-memory single-shard operation. Now that we're adding this to our stack, I'm trying to understand the use cases where Aerospike would not be able to replace redis? 回答1: Aerospike supports less data types than Redis, for example pub

How to fetch primary key in Aerospike Node.js Client

喜你入骨 提交于 2019-12-22 08:19:49
问题 I'm trying to fetch all records along with Primary key from Aerospike. I tried using client.query functionality as below var query = client.query(aerospikeDBParams.dbName,"testRecords"); var stream = query.execute(); with this I'm getting all the fields except the Primary key.How can i get Primary key along with the other fields? Thanks in advance 回答1: You first need to actually store the primary key with the record. The client and server locate the record using its digest, which the client