Hazelcast Imap.values(Predicate) miss data - hazelcast-imap

I am using hazelcast3.3.3 for cache.When I use IMap.values(Predicate) querying data,I find a problem.When I use this query,I can find the data.The query is
the data is
but when I use this query,I can't find the data.I can make sure the nextExecuteTime is also meet the conditions.Is it a bug of hazelcast?Do you meet such environment?

It should work both ways. Could you try:
Predicates.and(
Predicates.lessThan("nextExecuteTime", 1463975296703), Predicates.regex("autoIncrementId", ".*[5,6,7,8,9]$")
)

Related

Gremlin/Tinkerpop - is there a way to add metadata to a union step so I know which query the resulting traversal came from?

This is a little strange, but I have a situation where it'd be beneficial for me to know which traversal an element came from.
For a simple example, something like this:
.union(
select('parent').out('contains'), //traversal 1
select('parent2').out('contains') //traversal 2
)
.dedup()
.project('id','traversal')
.by(id())
.by( //any way to determine which traversal it came from? or if it was in both? )
Edit: One thing I found is that I can use Map with Group/By to get partly there:
.union(
select('parent').out('contains')
.map(group().by(identity()).by(constant('t1'))),
select('parent2').out('contains')
.map(group().by(identity()).by(constant('t2'))),
)
.dedup() //Dedup isn't gonna work here because each hashmap will be different.
.project('id','traversal')
.by( //here I can't figure out how to read a value from the hashmap inline )
The above query without the project/by piece returns this:
[{v[199272505353083909]: 't1'}, {v[199272515180338177]: 't2'}]
Or is there a better way to do this?
Thanks!
One simple approach might be to just fold the results. If you get back an empty list you will know you did not find any on that "branch":
g.V('44').
union(out('route').fold().as('a').project('res','branch').by().by(constant('b1')),
out('none').fold().as('b').project('res','branch').by().by(constant('b2')))
which yields
{'res': [v[8], v[13], v[20], v[31]], 'branch': 'b1'}
{'res': [], 'branch': 'b2'}
UPDATED after discussion in comments to include an alternative approach that uses nested union steps to avoid the project step inside the union. I still think I prefer the project approach unless the performance when measured is not good.
g.V('44').
union(local(union(out('route').fold(),constant('b1')).fold()),
local(union(out('none').fold(),constant('b2')).fold()))
which yields
[[v[8], v[13], v[20], v[31]], 'b1']
[[], 'b2']

Adobe AEM Querybuilder Debugger - Multiple Paths and Multiple Nodenames

I am using querybuilder debugger and want to do a search where "nodename=.pdf OR nodename=.doc*" and "path=/content/dam/1 OR path=/content/dam/2".
I have been trying to find an example but no luck on the web. What I have below is not quite right - just wondering what I am missing.
The query does work but there is a huge difference in the amount of time that it runs when compared with when I just query using one nodename instead of 2.
Thanks in advance,
Jerry
type=dam:asset
mainasset=true
1_group.p.or=true
1_group.1.nodename=*.pdf
1_group.2.nodename=*.doc*
2_group.p.or=true
2_group.1_path=/content/dam/1
2_group.2_path=/content/dam/2
p.limit=-1
orderby=path
I thought maybe something as simple as this might work but no luck....
type=dam:asset
mainasset=true
group.p.or=true
group.1_nodename=*.doc*
group.1_path=/content/dam/1
group.2_nodename=*.doc*
group.2_path=/content/dam/2
group.3_nodename=*.pdf
group.3_path=/content/dam/1
group.4_nodename=*.pdf
group.4_path=/content/dam/2
p.limit=-1
orderby=path
Try splitting your query if this won't affect the behaviour you're trying to achieve.
path=/content/dam/1
type=dam:asset
mainasset=true
group.1.nodename=*.pdf
group.2.nodename=*.doc*
p.limit=-1
orderby=path
path=/content/dam/2
type=dam:asset
mainasset=true
group.1.nodename=*.pdf
group.2.nodename=*.doc*
p.limit=-1
orderby=path

Gremlin order on Map results

I have the below query:
g.V('1')
.union(
out('R1')
.project('timestamp', 'data')
.by('completionDate')
.by(valueMap().by(unfold()))
out('R2')
.project('timestamp', 'data')
.by('endDate')
.by(valueMap().by(unfold()))
)
How can I order the UNION results by timestamp?
I've tried using ".order().by('timestamp')" but this only works on traversals and UNION returns a MAP object.
Here are a couple of ways to approach it. First, you could just use your code as-is and then order() by the "timestamp":
g.V('1').
union(out('R1').
project('timestamp', 'data').
by('completionDate').
by(valueMap().by(unfold())),
out('R2').
project('timestamp', 'data').
by('endDate').
by(valueMap().by(unfold()))).
order().by(select('timestamp'))
Note the difference is to select() the key from the Map that you want to sort on. Versions after 3.4.5 will work more as you expect and you can simply do by('timestamp') for a Map as well as an Element.
I think that a more readable approach however would be to go with this approach:
g.V('1').
out('R1','R2').
project('timestamp', 'data').
by(coalesce(values('endDate'), values('completionDate'))).
by(valueMap().by(unfold())).
order().by(select('timestamp'))
You might need to enhance the by(coalesce(...)) depending on the nature of your schema, but hopefully you get the idea of what I'm trying to do there.

Where can I find all command functions of Atom editor?

I can't find anywhere on the internet. I made some custom key bindings using stuff like:
editor = #getModel()
bufferRow = editor.bufferPositionForScreenPosition(editor.getCursorScreenPosition()).row
if editor.isFoldedAtBufferRow(bufferRow)
editor.unfoldBufferRow(bufferRow)
else
editor.foldBufferRow(bufferRow)
and
atom.workspace.getActiveTextEditor()?.selectAll()
atom.workspace.getActiveTextEditor()?.pasteText()
atom.workspace.getActiveTextEditor()?.save()
But I had to search so much. No list of all functions to use?
PS: Best thing close to it for me was: https://gist.github.com/philipmadeley/1fb35efdf5ab639c12c6
Atom has an abundance of documentation over at https://atom.io/docs/
More specifically, this would be what you were looking for:
https://atom.io/docs/api/v1.16.0/TextEditor

Xquery too much information returned from the function distinctive-terms

I'm trying to find the distinctive terms from a text using xquery in marlogic. When I use distinctive terms I got the following results
<cts:term id="146927407734894632" val="1142" score="292352" confidence="0.990467" fitness="1">
<cts:element-word-query>
<cts:element xmlns:rec="http://xxx.xxx/xxx">rec:Text</cts:element>
<cts:text xml:lang="en">ram</cts:text>
<cts:option>case-insensitive</cts:option>
<cts:option>diacritic-insensitive</cts:option>
<cts:option>stemmed</cts:option>
<cts:option>unwildcarded</cts:option>
</cts:element-word-query>
</cts:term>
This is too much information for me. I'm only interested in <cts:text xml:lang="en">ram</cts:text>. Is there a way to just get the results of this line?
You can pull the cts:text out from the results with XPath:
cts:distinctive-terms(...)//cts:text

Resources