I'm trying to stream data into Ignite via the following StreamVisitor:
val streamer = ignite.dataStreamer[ProductKey, Product]("products")
streamer.allowOverwrite(true)
streamer.autoFlushFrequency(100)
streamer.receiver(new StreamVisitor[ProductKey, Product] {
val atomic = ignite.atomicLong(s"version#${input.inventoryId}", 0L, true)
def apply(cache: IgniteCache[ProductKey, Product], entry: Entry[ProductKey, Product]): Unit = {
def updateProduct(key: ProductKey, product: Product): Unit = {
val version = atomic.incrementAndGet()
println(s"Updating product ${product.productId} to version $version")
cache.put(key, product.copy(version = version))
// versionChangeQueue.add(VersionChange(product.inventoryId, version))
}
val key = entry.getKey
val product = entry.getValue
val current = cache.get(key)
if (current == null) {
updateProduct(key, product)
} else {
if (attributesDiffer(product.attributes, current.attributes)) {
updateProduct(key, product)
} else {
println(s"Product ${product.productId} hasn't changed")
}
}
}
private def attributesDiffer(newAttributes: Map[UUID, String], oldAttributes: Map[UUID, String]): Boolean = {
newAttributes exists {
case (id, value) => oldAttributes.getOrElse(id, "") != value
}
}
})
I repeatedly addData and then flush. Even though I see this:
18:31:04.672 INFO o.a.i.i.m.d.GridDeploymentLocalStore - Class locally deployed: class io.livefeeds.api.pull.PullWorker$$anon$1
I often get a long stream of the following exceptions:
[18:41:07] (err) Failed to execute compound future reducer: GridCompoundFuture [rdc=null, initFlag=1, lsnrCalls=0, done=false, cancelled=false, err=null, futs=[true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]]class org.apache.ignite.IgniteCheckedException: DataStreamer request failed [node=a568919f-5f9a-4bdc-ae0a-3360a0179319]
at org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$Buffer.onResponse(DataStreamerImpl.java:1857)
at org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$3.onMessage(DataStreamerImpl.java:336)
at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
at org.apache.ignite.internal.util.StripedExecutor$Stripe.run(StripedExecutor.java:505)
at java.lang.Thread.run(Thread.java:745)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to get deployment for request [sndId=2e500b52-0416-46bd-bcd9-b72c57c77f4a, req=DataStreamerRequest [reqId=1, cacheName=products, ignoreDepOwnership=true, skipStore=false, keepBinary=false, depMode=SHARED, sampleClsName=io.livefeeds.api.pull.PullWorker$$anon$1, userVer=0, ldrParticipants=null, clsLdrId=75eaedb7161-2e500b52-0416-46bd-bcd9-b72c57c77f4a, forceLocDep=false, topVer=AffinityTopologyVersion [topVer=10, minorTopVer=0], partId=-2147483648]]
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.processRequest(DataStreamProcessor.java:273)
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.access$000(DataStreamProcessor.java:59)
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor$1.onMessage(DataStreamProcessor.java:89)
at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
at org.apache.ignite.internal.util.StripedExecutor$Stripe.run(StripedExecutor.java:505)
at java.lang.Thread.run(Thread.java:748)
[18:41:07] (err) Failed to execute compound future reducer: GridCompoundFuture [rdc=null, initFlag=1, lsnrCalls=0, done=false, cancelled=false, err=null, futs=[true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]]class org.apache.ignite.IgniteCheckedException: DataStreamer request failed [node=a568919f-5f9a-4bdc-ae0a-3360a0179319]
at org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$Buffer.onResponse(DataStreamerImpl.java:1857)
at org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$3.onMessage(DataStreamerImpl.java:336)
at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
at org.apache.ignite.internal.util.StripedExecutor$Stripe.run(StripedExecutor.java:505)
at java.lang.Thread.run(Thread.java:745)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to get deployment for request [sndId=2e500b52-0416-46bd-bcd9-b72c57c77f4a, req=DataStreamerRequest [reqId=1, cacheName=products, ignoreDepOwnership=true, skipStore=false, keepBinary=false, depMode=SHARED, sampleClsName=io.livefeeds.api.pull.PullWorker$$anon$1, userVer=0, ldrParticipants=null, clsLdrId=75eaedb7161-2e500b52-0416-46bd-bcd9-b72c57c77f4a, forceLocDep=false, topVer=AffinityTopologyVersion [topVer=10, minorTopVer=0], partId=-2147483648]]
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.processRequest(DataStreamProcessor.java:273)
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.access$000(DataStreamProcessor.java:59)
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor$1.onMessage(DataStreamProcessor.java:89)
at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
at org.apache.ignite.internal.util.StripedExecutor$Stripe.run(StripedExecutor.java:505)
at java.lang.Thread.run(Thread.java:748)
And the server log says:
[13:38:02,507][WARNING][data-streamer-stripe-5-#14%livefeeds-dev%][GridDeploymentCommunication] Failed to receive peer response from node within duration [node=ee600e02-bf03-4793-8ca1-623b8b0faa52, duration=5005]
[13:38:02,508][WARNING][data-streamer-stripe-5-#14%livefeeds-dev%][GridDeploymentPerVersionStore] Failed to get resource from node (is node alive?) [nodeId=ee600e02-bf03-4793-8ca1-623b8b0faa52, clsLdrId=039dbdb7161-ee600e02-bf03-4793-8ca1-623b8b0faa52, resName=io/livefeeds/api/pull/PullWorker$$anon$1.class, parentClsLdr=sun.misc.Launcher$AppClassLoader#764c12b6]
What is actually going wrong here?
The problem here seemed to be closing over the Ignite instance. I created a standalone FeedVisitor class, with an #IgniteInstanceResource, in a JAR deployed to the server. The standalone class might also work with peer class loading, though.
Related
I'm trying to add new option like invite more people not by link but with a call notification.
anyone solved this issue ?? please help.
you can use feature flages like below
Map<FeatureFlag, Object> featureFlags = {
FeatureFlag.isMeetingNameEnabled: false,
FeatureFlag.isServerUrlChangeEnabled: true,
FeatureFlag.isChatEnabled: false,
FeatureFlag.isAddPeopleEnabled: false,
FeatureFlag.areSecurityOptionsEnabled: false,
FeatureFlag.isCalendarEnabled: false,
FeatureFlag.isCloseCaptionsEnabled: false,
FeatureFlag.isFilmstripEnabled: false,
FeatureFlag.isHelpButtonEnabled: false,
FeatureFlag.isInviteEnabled: false,
FeatureFlag.isLiveStreamingEnabled: false,
FeatureFlag.isLobbyModeEnabled: false,
FeatureFlag.isOverflowMenuEnabled: false,
FeatureFlag.isReactionsEnabled: false,
FeatureFlag.isRaiseHandEnabled: false,
FeatureFlag.isRecordingEnabled: false,
FeatureFlag.isReplaceParticipantEnabled: false,
};
var options = JitsiMeetingOptions(
isVideoMuted: true,
roomNameOrUrl: name,
userDisplayName: prefs.getString('username')!,
serverUrl: 'https://**********',
featureFlags: featureFlags,
);
I get an error (Gtk-WARNING **: 18:33:56.632: Attempting to add a widget with type GtkBox to a GtkDialog, but as a GtkBin subclass a GtkDialog can only contain one widget at a time; it already contains a widget of type GtkBox)
when executing this code:
def switchfile(self, widget):
self.cd = None
self.cd = {
'win' : Gtk.Dialog(),
'entry' : Gtk.Entry(),
'btnok' : Gtk.Button.new_from_icon_name("document-open-symbolic", Gtk.IconSize.MENU),
'label' : Gtk.Label(),
'vbox' : Gtk.Box(orientation=Gtk.Orientation.VERTICAL),
'hbox' : Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
}
self.cd['entry'].set_placeholder_text('Notebook Name')
self.cd['btnok'].connect('clicked', self.switch_yes)
self.cd['hbox'].pack_start(self.cd['entry'], True, True, 0)
self.cd['hbox'].pack_start(self.cd['btnok'], True, True, 0)
self.cd['vbox'].pack_start(self.cd['label'], True, True, 0)
self.cd['vbox'].pack_start(self.cd['hbox'], True, True, 0)
self.cd['vbox'].show_all()
self.cd['win'].add(self.cd['vbox'])
self.cd['win'].show_all()
self.cd['win'].run()
But, if there already is a Gtk.Box in the Gtk.Dialog, how can I access it?
In another Question on Stackoverflow, there was a Dialog.get_vbox()function, but it was C/C++ and when i use bpython3 to list the functions in Gtk.Dialog, it has nothing, no get_vbox(), an also nothing else like get_vbox: no get_box()' and no get_container()`.
How can I access the Gtk.Box in Gtk.Dialog
Information:
I am using Version 3.0 of gi.repository.Gtk
Now I found out how to do it.
def switchfile(self, widget):
self.cd = None
self.cd = {
'win' : Gtk.Dialog(),
'entry' : Gtk.Entry(),
'btnok' : Gtk.Button.new_from_icon_name("document-open-symbolic", Gtk.IconSize.MENU),
'label' : Gtk.Label(),
'vbox' : None,
'hbox' : Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
}
self.cd['win'].add_buttons(
Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OK, Gtk.ResponseType.OK
)
self.cd['vbox'] = self.cd['win'].get_content_area()
self.cd['entry'].set_placeholder_text('Notebook Name')
self.cd['btnok'].connect('clicked', self.switch_yes)
self.cd['hbox'].pack_start(self.cd['entry'], True, True, 0)
self.cd['hbox'].pack_start(self.cd['btnok'], True, True, 0)
self.cd['vbox'].pack_start(self.cd['label'], True, True, 0)
self.cd['vbox'].pack_start(self.cd['hbox'], True, True, 0)
self.cd['vbox'].show_all()
self.cd['win'].show_all()
self.cd['win'].run()
Important is this line:
self.cd['vbox'] = self.cd['win'].get_content_area()
I didn't know about that function, but this is how to access the Gtk.Box in Gtk.Dialog objects.
I'm using amchart to show my data analytics in the Angular app. If I run an E2E test on that page that contains the amchart plugin, it's not able to finish (script timeout) cause it using real-time updates for charts (dynamic)...
This command 'getAllAngularTestabilities()' in console shows that has been pendingMacrotasks on page, so if the Protractor not working here, it's totally okay.
[Testability]
0: Testability
taskTrackingZone: TaskTrackingZoneSpec {name: "TaskTrackingZone", microTasks: Array(0), macroTasks: Array(3), eventTasks: Array(474), properties: {…}}
_callbacks: []
_didWork: true
_isZoneStable: true
_ngZone: NgZone
hasPendingMacrotasks: true
hasPendingMicrotasks: false
isStable: true
lastRequestAnimationFrameId: -1
nativeRequestAnimationFrame: ƒ requestAnimationFrame()
onError: EventEmitter_ {_isScalar: false, observers: Array(1), closed: false, isStopped: false, hasError: false, …}
onMicrotaskEmpty: EventEmitter_ {_isScalar: false, observers: Array(1), closed: false, isStopped: false, hasError: false, …}
onStable: EventEmitter_ {_isScalar: false, observers: Array(2), closed: false, isStopped: false, hasError: false, …}
onUnstable: EventEmitter_ {_isScalar: false, observers: Array(1), closed: false, isStopped: false, hasError: false, …}
shouldCoalesceEventChangeDetection: false
I have 3 charts on that page, so I checked what NgZone says: Coming to a request in every second, and I can't turn off them. I'm trying to find the solution in amchart's documentation but I haven't found anything yet...
ZONE pending tasks=
(3) [ZoneTask, ZoneTask, ZoneTask]
0: ZoneTask
callback: ƒ ()
cancelFn: undefined
creationLocation: Error: Task 'macroTask' from 'setTimeout'. at TaskTrackingZoneSpec.push.FGvd.TaskTrackingZoneSpec.onScheduleTask (http://localhost:4200/vendor.js:54102:40) at ZoneDelegate.scheduleTask (http://localhost:4200/polyfills.js:9471:55) at Object.onScheduleTask (http://localhost:4200/polyfills.js:9365:69) at ZoneDelegate.scheduleTask (http://localhost:4200/polyfills.js:9471:55) at Zone.scheduleTask (http://localhost:4200/polyfills.js:9303:47) at Zone.scheduleMacroTask (http://localhost:4200/polyfills.js:9326:29) at scheduleMacroTaskWithCurrentZone (http://localhost:4200/polyfills.js:10227:29) at http://localhost:4200/polyfills.js:11679:34 at proto.<computed> (http://localhost:4200/polyfills.js:10542:52) at loop_1 (http://localhost:4200/vendor.js:23731:42)
data: {isPeriodic: false, delay: 1000, args: Arguments(2), handleId: 1516}
invoke: ƒ ()
runCount: 0
scheduleFn: ƒ scheduleTask(task)
source: "setTimeout"
type: "macroTask"
_state: "notScheduled"
_zone: Zone {_parent: Zone, _name: "angular", _properties: {…}, _zoneDelegate: ZoneDelegate}
_zoneDelegates: null
state: (...)
zone: (...)
__proto__: Object
1: ZoneTask {_zone: Zone, runCount: 0, _zoneDelegates: null, _state: "notScheduled", type: "macroTask", …}
2: ZoneTask {_zone: Zone, runCount: 0, _zoneDelegates: null, _state: "notScheduled", type: "macroTask", …}
length: 3
__proto__: Array(0)
UPDATE!
I can avoid this problem with a tiny workaround.
Need to create a function that using runOutsideAngular(), and if I create the chart inside the callback, no will be running macrotasks!
constructor(#Inject(PLATFORM_ID) private platformId, private zone: NgZone) {
}
// Run the function only in the browser
browserOnly(f: () => void): void {
if (isPlatformBrowser(this.platformId)) {
this.zone.runOutsideAngular(() => {
f();
});
}
}
ngOnInit(): void {
this.browserOnly(() => {
this.chart = am4core.create('line-chart-placeholder', am4charts.XYChart);
});
}
yes, you can ignore it. You need to disable main protractor's feature that waits for page to be ready, like this
await browser.waitForAngularEnabled(false)
for more info, read here
I am using conversejs as client for providing a multiuser chat embeded in an html page. User might be added to a lot of groups. When a user is chating in a group and gets invite to join another group a popup is shown to accept the invite, i do not want the user to see that invitation and rather user should stay in the same group that he has opened.
Given bellow is the initialization sample :
converse.initialize({
authentication: 'login',
credentials_url: 'https://myserver.primet.com/chatapi/apiserver/api/chat/autologin/auth?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyJ9.eyJhdWQiOiI2YTE1NzNkMS03ZDZjLTRkZGItYjVlYS1hZGQyZWM1MDkzZjEiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vZmNlNTAxOTUtMjMxNS00N2FmLWE2ODQtZmY5M',
auto_login: 'true',
bosh_service_url: 'https://myserver.primet.com/chatserver/http-bind/',
jid: ‘james#qachatserver.primet.com',
keepalive: true,
trusted: false,
auto_reconnect: true,
muc_nickname_from_jid: true,
auto_join_rooms: ['deal_909090390898989090909#conference.qachatserver.primet.com'],
auto_focus: false,
locked_muc_nickname: true,
show_desktop_notifications: false,
send_chat_state_notifications: false,
blacklisted_plugins: [
'converse-notification'
],
singleton: true,
muc_show_join_leave: false,
visible_toolbar_buttons: {
call: false,
spoiler: false,
emoji: false,
toggle_occupants: true
},
notify_all_room_messages: false,
notification_delay: 3000,
allow_message_corrections: 'false',
view_mode: 'embedded'
}).then(() => { setTimeout(function(){ var toggleButton = document.getElementsByClassName('toggle-occupants fa fa-angle-double-right')[0]; if (toggleButton) { toggleButton.click(); toggleButton.style.display="none"}},500);})
You can set allow_muc_invitations to false.
def socket: WebSocket = {
WebSocket.acceptOrResult[Message, Message] { implicit request: RequestHeader =>
serviceUserIdentity.getUserIdentity(request) map {
case Some(userIdentityPlay) if userIdentityPlay.hasValidLicense =>
Right(
ActorFlow.actorRef(out =>
ActorWSServer.props(out)
)
)
case Some(_) =>
Left(Results(4403)) //invalid user
case None =>
Left(Results(4401)) //session expired
} recover {
case exception: Exception =>
Left(InternalServerError)
}
}
}
This CloseEvent is what I get back from the server when the user doesn't have a valid license or he's session is expired.
CloseEvent {isTrusted: true, wasClean: false, code: 1006, reason: "", type: "close", …}
It looks like Result Http code (4403) is getting overwritten to 1006.
The result that I am expecting:
CloseEvent {isTrusted: true, wasClean: false, code: 4403, reason: "", type: "close", …}
Is there a way to achieve this at WebSocket.accept?
Or a workaround using play.api.http.websocket.CloseMessage?