i couldn't find GridRichNode in GridGain 6.0.3, is there an alternative to this class?
GridRichNode was removed in GridGain 6.0.3 to remove duplicity that existed between GridNode and GridRichNode APIs.
To get the same functionality as for GridRichNode, you now need to get a projection over a specific node, like so:
GridNode node = ...; // Get a single node.
GridProjection nodePrj = grid.forNode(node);
// Send a message to specific node.
nodePrj.send(...)
Related
Using the SAP B1 .edmx with 3.39.0 and trying to update DeliveryNotes with new DocumentPackages. However, the list of DocumentPackage that eventually gets passed by the execution of the update operation is empty.
Code:
var packagesUpdateDocument = new Document();
packagesUpdateDocument.setDocEntry(1);
var documentPackages = new ArrayList<DocumentPackage>();
var documentPackage = new DocumentPackage();
documentPackage.setNumber(10);
documentPackages.add(documentPackage);
packagesUpdateDocument.setDocumentPackages(documentPackages);
var updateDeliveryPackagesRequest = service.withServicePath("etc")
.updateDeliveryNotes(packagesUpdateDocument);
var updateDeliveryPackagesResponse = updateDeliveryPackagesRequest.tryExecute(serviceLayerDestination);
Looking at the logs of the service layer I can see this is the request which was eventually sent by the client:
PATCH /b1s/v2/DeliveryNotes(1)
{"DocEntry":1,"DocumentPackages":[{}],"#odata.type":"SAPB1.Document"}
From my understanding, PATCH requests will automatically disregard anything the generated client deems as 'unchanged.'
Printing the changed fields:
System.out.println(packagesUpdateDocument.getChangedFields());
Yields:
{
DocEntry=175017,
DocumentPackages=
[DocumentPackage
(
super=VdmObject(customFields={},
changedOriginalFields={}),
odataType=SAPB1.DocumentPackage,
number=10,
)
]
.....
}
I believe the Package is not recording the fields which have changed. Although I am not certain.
Is there a step I am missing or is this a feature gap?
As of SAP Cloud SDK 3.42.0 we support updating complex properties with PATCH out-of-the-box. See the release notes for more details.
Yes this is a feature gap currently. PATCH will only consider properties of the root entity and navigation properties while disregarding changes in complex properties.
Until that is supported updating with PUT instead via the .replacingEntity() option should work.
Recently I have decided to replace arrays with priority queues for storing my list of jobs for a user into MongoDB. I use NodeJS and ExpressJS for backend. The priority queue I attempted to store is from an external package which can be installed by running the following command in terminal:
yarn add js-priority-queue
For some reason the priority queue works perfectly prior to storing it into MongoDB. However, the next time I attempt to take it out of MongoDB and use it, its functionality is missing. I declare its type as Schema.Types.Mixed in the Schema. Am I doing something wrong or is it not possible to store instantiated class objects into MongoDB?
As far as I know, when you store things in MongoDB they are stored as extended JSON (EJSON) in binary format (BSON)
const { EJSON } = require('bson');
const test = EJSON.stringify({a: new Date(), foo:function(){console.log('foo');}})
console.log(test) // "{"a":{"$date":"2020-07-07T14:45:49.475Z"}}"
So any sort of function is lost.
For library arangodb-spring-data, version 3.2.3, is there any possibility to query for GEO_INTERSECTS functionality using the java api provided by the driver?
Currently I am using an AQL query in my code:
LET areaLiteral = GEO_POLYGON(...)
FOR doc IN MyDocuments
FILTER GEO_INTERSECTS(areaLiteral, doc.geometry)
LIMIT 5 RETURN doc
So far in the official documentation couldn't find anything related to GEO_INTERSECTS, also in this example: https://github.com/arangodb/spring-data-demo#geospatial-queries
I have checked the source code of the driver, but didn't find anything related to keyword "INTERSECTS" which would construct this query behind the scenes.
It is not yet supported, the only supported geospatial queries are Near and Within:
https://www.arangodb.com/docs/3.6/drivers/spring-data-reference-repositories-queries-derived-queries.html#geospatial-queries
I am using Spark-Solr connector 3.4.0 with Solr cloud version 7.6.0 in a Spark 2.2.1 Cluster . We have an existing Solr collection with a predefined schema for it. Most of the fields have the stored parameter set to true, but there are certain fields where we explicitly set stored=false. When we try to push data to Solr using the spark-solr connector, we get the following error-
org.apache.solr.api.ApiBag$ExceptionWithErrObject: error processing commands, errors: [{add-field={name=taxonomy, indexed=true, multiValued=true, docValues=true, stored=true, type=string}, errorMessages=[Field 'item_id_channel' already exists.
]}],
at org.apache.solr.handler.SchemaHandler.handleRequestBody(SchemaHandler.java:92)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:199)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:2541)
at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:709)
at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:515)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:377)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:323)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
The error says the item_id_channel already exists, but this error is only raised for fields for which we have defined stored=false (in the Solr schema). I get that the connector wishes to create the schema again for some reason, but it sets the stored parameter to true which clashes with the predefined schema definition on Solr for this field.
My question is - Is there a way to tell the connector (probably through some option?) that we want the stored to be set to true for certain fields? And probably a generic way to define other solr parameters for the fields?
We found the issue that was causing the error. There was a bug in older versions of spark-solr connector, because of which the connector was trying to add existing fields to the solr schema in case the value of stored was true. This was fixed in 3.5.5 release. Hence, once we upgraded our connector to version 3.5.14, the ingestion stared working without any errors.
In GridGain 6, can I obtain GridStreamer instance on remote node and use it to addEvents?
The idea is that I need a node, which can generate data for stream processing, but not to participate in processing itself.
All nodes, launched with StreamConfiguration section automatically participate in processing of events. And if node is launched without StreamConfiguration section - then its Grid instance don't see other streamers.
GridClient seems don't support streaming
You cannot get streamer instance on node which does not have this particular streamer configured. However, you can easily achieve your requirement by providing GridStreamerEventRouter that will not route events on nodes which are not supposed to participate in event processing.
For example, you can use random event router with predicate which will filter nodes by user attribute (you can set user attributes for a node with GridConfiguration.setUserAttributes(...)):
GridStreamerConfiguration streamCfg = new GridStreamerConfiguration();
//...
streamCfg.setRouter(new GridStreamerRandomEventRouter(new GridPredicate<GridNode>() {
#Override public boolean apply(GridNode node) {
return !"CLIENT".equals(node.attribute("STREAMER_ROLE"));
}
}));