<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Mircea,<br>
<br>
I applaud the effort and your experiment! Having said that I think
we have to engineer a much more plumbing for more complicated cases,
e.g map/reduce (marshalling results, classloading etc etc). I am
more and more convinced nowadays that all of this plumbing is better
provided by AS itself rather than us reinventing the wheel here...<br>
<br>
WDYT?<br>
<br>
Vladimir<br>
On 11-07-15 7:53 AM, Mircea Markus wrote:
<blockquote
cite="mid:C821E44E-8FB9-43BC-9F94-1D9143FFF243@jboss.com"
type="cite">Hi,
<div><br>
</div>
<div>As there is a high community demand for having these
operations in place, and most of these are targeted for post 5.1
releases, I thought about a workaround for having this
functionality in place. </div>
<div>I hijacked Hotrod's put operation and added a custom
interceptor, so that if a certain object is being "put" into
remote cache, the server side interceptor jumps in and runs
transactions.</div>
<div>This doesn't look too bad for the user, e.g. for supporting
transactions:</div>
<div><br>
</div>
<div>
<meta charset="utf-8">
<span class="Apple-style-span" style="font-family: helvetica,
arial, freesans, clean, sans-serif; font-size: 14px;
line-height: 19px; ">
<pre style="margin-top: 20px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; font: normal normal normal 12px/normal 'Bitstream Vera Sans Mono', Courier, monospace; background-color: rgb(248, 248, 248); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); font-size: 13px; line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; "><code style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding
-right: 0px; padding-bottom: 0px; padding-left: 0px; font: normal normal normal 12px/normal 'Bitstream Vera Sans Mono', Courier, monospace; background-color: transparent; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-top-color: rgb(222, 222, 222); border-right-color: rgb(222, 222, 222); border-bottom-color: rgb(222, 222, 222); border-left-color: rgb(222, 222, 222); font-size: 13px; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; ">RemoteCache rc = getRemoteCache();//from somewhere...
//this is what we'll use for running remote transactions over hotrod
BatchEnabledRemoteCache berc = new BatchEnabledRemoteCache(rc);
berc.startBatch(); //everything from here to endBatch call is a single transaction
berc.put("k", "v1");
berc.put("k2", "v2");
berc.put("k3", "v3");
berc.endBatch(true); // all or nothing!
</code></pre>
<div><code style="margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 0px; padding-top: 0px;
padding-right: 0px; padding-bottom: 0px; padding-left:
0px; font: normal normal normal 12px/normal 'Bitstream
Vera Sans Mono', Courier, monospace; background-color:
transparent; border-top-width: 1px; border-right-width:
1px; border-bottom-width: 1px; border-left-width: 1px;
border-top-style: none; border-right-style: none;
border-bottom-style: none; border-left-style: none;
border-top-color: rgb(222, 222, 222); border-right-color:
rgb(222, 222, 222); border-bottom-color: rgb(222, 222,
222); border-left-color: rgb(222, 222, 222); font-size:
13px; border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px; border-width: initial;
border-color: initial; "><br>
</code></div>
<div><font class="Apple-style-span" face="'Bitstream Vera Sans
Mono', Courier, monospace" size="3"><span
class="Apple-style-span" style="font-size: 13px;
line-height: normal;"><br>
</span></font></div>
<div><font class="Apple-style-span" face="'Bitstream Vera Sans
Mono', Courier, monospace" size="3"><span
class="Apple-style-span" style="font-size: 13px;
line-height: normal;"><span class="Apple-style-span"
style="font-family: Helvetica; font-size: medium; ">Of
course this won't work with other clients than the
java client, but I think most of our users are using
that one ATM. </span></span></font></div>
<div><font class="Apple-style-span" face="'Bitstream Vera Sans
Mono', Courier, monospace" size="3"><span
class="Apple-style-span" style="font-size: 13px;
line-height: normal;"><span class="Apple-style-span"
style="font-family: Helvetica; font-size: medium; ">Currently
there's only support for transactions but this
approach (and the code) can be easily extended to
mapreduce and querying. </span></span></font></div>
<div><font class="Apple-style-span" face="Helvetica"><span
class="Apple-style-span" style="line-height: normal;
font-size: medium;">I added s short description on how
this can be used [1], also the source code is available
here[2].</span></font></div>
<div><font class="Apple-style-span" face="Helvetica"><span
class="Apple-style-span" style="line-height: normal;
font-size: medium;"><br>
</span></font></div>
<div><font class="Apple-style-span" face="Helvetica"><span
class="Apple-style-span" style="line-height: normal;
font-size: medium;">What do you think about it? Is it
worth suggesting to the users this approach(and possibly
the code as well)?</span></font></div>
<div><font class="Apple-style-span" face="Helvetica"><span
class="Apple-style-span" style="line-height: normal;
font-size: medium;"><br>
</span></font></div>
<div><font class="Apple-style-span" face="Helvetica"><span
class="Apple-style-span" style="line-height: normal;
font-size: medium;">Cheers,</span></font></div>
<div><font class="Apple-style-span" face="Helvetica"><span
class="Apple-style-span" style="line-height: normal;
font-size: medium;">Mircea</span></font></div>
<div><font class="Apple-style-span" face="Helvetica"><span
class="Apple-style-span" style="line-height: normal;
font-size: medium;"><br>
</span></font></div>
<div><font class="Apple-style-span" face="Helvetica"><span
class="Apple-style-span" style="line-height: normal;
font-size: medium;">[1] </span></font><a
moz-do-not-send="true"
href="https://github.com/mmarkus/ops_over_hotrod/wiki/Usage-guide">https://github.com/mmarkus/ops_over_hotrod/wiki/Usage-guide</a></div>
<div><font class="Apple-style-span" face="Helvetica"><span
class="Apple-style-span" style="line-height: normal;
font-size: medium;">[2]</span></font><a
moz-do-not-send="true"
href="https://github.com/mmarkus/ops_over_hotrod">https://github.com/mmarkus/ops_over_hotrod</a></div>
</span></div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
infinispan-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/infinispan-dev">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></pre>
</blockquote>
<br>
</body>
</html>