How to return more then one result with zpop in Redis - redis

Zpop command in Redis returns a single result
Is there a way for zpop more then one result in a single execution?

What version of Redis are you using? According to official documentation, Redis has ZPOPMIN and ZPOPMAX and no ZPOP command.
The ZPOPMIN and ZPOPMAX commands both accept as a second optional argument the amount of members to pop.

Related

Unpickle Celery results in BLOB using SQL

I am using the Oracle result_backend to store the Celery results, which are in BLOB format. When I connect to the db with python and use pickle.loads() it will work, but when I try to decode them in Oracle SQL using to_char(dbms_lob.substr(BLOB_FIELD)) did not work.
e.g. instead of echo 'Test' I see ��
I would rather recommend you to change result serialisation to use JSON or YAML. It should be as simple as setting the result_serializer parameter to 'json' or 'yaml'. I know very little about Oracle, but I would assume it knows nothing about Python's pickle...
Celery older than 4.0 used pickle by default. They changed that to JSON in 4.0 and later versions.

Zeppelin alternative for K-V store

Any alternative for checking key-value entries while debugging the Ignite application? Zeppelin can be able to do only SQL querying. Visor command -> modify -get -c=CName is very tedious to work on and also can't get entries by wildcard searching of keys. Or is there any way we can query the K-V store via SQL Queries?
You can use:
1)REST
https://apacheignite.readme.io/docs/rest-api#get-and-remove
2)Create the thick JAVA, .NET, C++ clients that will use native cache API
3)Node JS client:
https://github.com/apache/ignite/blob/master/modules/platforms/nodejs/examples/CachePutGetExample.js
4)Python client:
https://apacheignite.readme.io/docs/python-thin-client-key-value
5)PHP client:
https://apacheignite.readme.io/docs/php-thin-client-key-value
Probably I missed some integrations.
Also as I know Zeppelin supports cacheAPI using Scala syntax:
https://zeppelin.apache.org/docs/0.8.0/interpreter/ignite.html
val cache: IgniteCache[AffinityUuid, String] = ignite.cache("words")
And the final way. You can add query entity to your cache and run the queries like next:
select _key, _val from table;

Redis How to get current database name

Is there any command in Redis to get the database name that I am using right now?
I know select is to switch the database. I am looking for "get database name" kind of a command.
First of all, there's NO name for Redis database. Instead, it has an index.
You can use the CLIENT SETNAME and CLIENT LIST commands to get the database index dynamically:
call CLIENT SETNAME a-unique-name to set a unique name for the current connection.
call CLIENT LIST to get info of all clients that connecting to Redis.
find the connection info with the unique name that we set in step 1.
parse the client info the get the database index.
You can get the format of client info from the doc.
NOTE: If anyone has a simpler solution, please let me know :)
UPDATE: Since Redis 6.2.0, you can use CLIENT INFO to get the information of current connection. So that you don't need to run step 1 - 3 mentioned above.
Since Redis version 6.2.0 you can use the CLIENT INFO command, the response of which contains both the name and the db number of the current client connection.

NNTP command to get count of available newsgroups

Is there an NNTP command to return the count of NewsGroups on an USENET server? (Without having to retrieving the entire list.)
No, such a command is not available in RFC 3977.

Mysql query to return server load average

Does anyone know of a MySQL query that returns the server's current load average?
Do you mean the actual system load average? This has nothing to do with MySQL. For example on Linux, you can get it from /proc/loadavg.
Correct me if I'm wrong, but the load average variable is a property of the machine, not the MySQL server.
So to retrieve the avg. load you should be looking for a system call, not a SQL-query.
You might want to look into this statement:
http://dev.mysql.com/doc/refman/5.1/en/show-status.html
SHOW [GLOBAL | SESSION] STATUS
[LIKE 'pattern' | WHERE expr]
SHOW STATUS provides server status information. This information also can
be obtained using the mysqladmin
extended-status command. The LIKE
clause, if present, indicates which
variable names to match. The WHERE
clause can be given to select rows
using more general conditions, as
discussed in Section 20.28,
“Extensions to SHOW Statements”. This
statement does not require any
privilege. It requires only the
ability to connect to the server.
Do you have mytop installed?
mytop is a console-based (non-gui)
tool for monitoring the threads and
overall performance of a MySQL 3.22.x,
3.23.x, and 4.x server
Mytop allows you to monitor what is happening in real time, everything from number of queries per second to key efficiency of the queries.
See Using Mytop: A MySQL Monitor