Grizzly 2.0 Initial propose overview

Slides:



Advertisements
Similar presentations
OGSA-DAI Activities OGSA-DAI for Developers GridWorld 2006, Washington DC 11 September 2006.
Advertisements

COM vs. CORBA.
ASP.NET Best Practices Dawit Wubshet Park University.
1 Chapter 5 Threads 2 Contents  Overview  Benefits  User and Kernel Threads  Multithreading Models  Solaris 2 Threads  Java Threads.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
Practical Session 11 Multi Client-Server Java NIO.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
Fall 2000Datacom 11 Lecture 4 Socket Interface Programming: Service Interface between Applications and TCP.
What Is New and Noteworthy in Jersey Miroslav Fuksa, Jakub Podlešák Software Developers Oracle, Application Server Group October 1, 2014 Copyright ©
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Threads A thread (or lightweight process) is a basic unit of CPU.
Apache Mina Dima Ionut Daniel. Contents What is Apache Mina? Why Apache Mina? Mina Architecture Mina Core Mina Advanced JMX Support Spring Integration.
Message-Driven Beans and EJB Security Lesson 4B / Slide 1 of 37 J2EE Server Components Objectives In this lesson, you will learn about: Identify features.
Introduction to MINA A M ultipurpose I nfrastructure for N etwork A pplications April 2005, Trustin Lee, ASF.
© 2009 by Eike Stepper; made available under the EPL v1.0 | The Net4j Signalling Platform Developing Pluggable Client/Server Applications Eike.
Today’s Agenda  Quick Review  Finish Java Threads  The CS Problem Advanced Topics in Software Engineering 1.
Windows Network Programming ms-help://MS.MSDNQTR.2004JAN.1033/winsock/winsock/windows_sockets_start_page_2.htm 井民全.
DYNES Storage Infrastructure Artur Barczyk California Institute of Technology LHCOPN Meeting Geneva, October 07, 2010.
Eike Stepper ES-Computersysteme Berlin, Germany Net4j Signalling Platform Developing Pluggable Client/Server Applications.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
Practical Session 12 Reactor Pattern. Disadvantages of Thread per Client It's wasteful – Creating a new Thread is relatively expensive. – Each thread.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
Unified Distributed (UDub Mail) Life Cycle Objectives Sachin Pradhan Gabriel Maganis.
Practical Session 11 Multi Client-Server Java NIO.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Copyright © 2007 InSTech Joint Laboratory All rights reserved. 1 Consideration on Persistence of WiseMan FuDan-Hitachi InSTech (Innovative Software Technology)
Copyright (c) 2006 IBM Corporation; made available under the EPL v1.0 Update Policy ~ Where we are in 3.2.
Overview of Previous Lesson(s) Over View  ASP is a technology that enables scripts in web pages to be executed by an Internet server.  ASP.NET is a.
Designing a Middleware Server for Abstract Database Connection.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Overview of the Spring Framework Introducing.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
SPL/2010 Reactor Design Pattern 1. SPL/2010 Overview ● blocking sockets - impact on server scalability. ● non-blocking IO in Java - java.niopackage ●
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
Java Thread Programming
Chapter 4 Assignment Statement
Multi Threading.
Servlet Fudamentals.
Java Servlets By: Tejashri Udavant..
Eike Stepper Berlin, Germany
Java Beans Sagun Dhakhwa.
Chapter 2: System Structures
Trustin Lee Introduction to MINA Trustin Lee
Operating System (013022) Dr. H. Iwidat
Chapter 3 Assignment Statement
RDA3 high-level – API & architecture 26th JUNE 2013
Netty.
Chapter 4: Threads.
Chapter 26 Servlets.
High-performance network applications
Reactor Design Pattern
AVG 24th 2015 ADVANCED c# - part 1.
null, true, and false are also reserved.
Yet Another Memory Manager
Reactive microservice end to end from RxJava to the wire with gRPC
Yet Another Memory Manager
Chapter 40 Remote Method Invocation
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
Multithreading in java.
CSE 153 Design of Operating Systems Winter 19
Applet Fundamentals Applet are small applications that are accessed on an Internet server, transported over the Internet, automatically installed and run.
How to take advantage of the new Eclipse Debug Platform features
System Calls System calls are the user API to the OS
Chapter 13: I/O Systems.
Exceptions and networking
The reactor design pattern
Thread per client and Java NIO
Presentation transcript:

Grizzly 2.0 Initial propose overview Oleksiy Stashok 1

Agenda Grizzly 2.0 goals Architecture Grizzly 1.x architecture solutions to be changed Abstractions overview Examples

Agenda Grizzly 2.0 goals Architecture Grizzly 1.x architecture solutions to be changed Abstractions overview Examples

1. Grizzly 2.0 goals Make framework core API more clear and useful, based on earlier experience Performance. Make sure API changes will not affect the performance, which is still the main goal for Grizzly Introduce unified Buffer/Memory management API Unify ThreadPool implementation. Make it compatible with Thread pool abstractions, provided by JDK.

Agenda Grizzly 2.0 goals Architecture Grizzly 1.x architecture solutions to be changed Abstractions overview Examples

Agenda Grizzly 2.0 goals Architecture Grizzly 1.x architecture solutions to be changed Abstractions overview Examples

2.1 Grizzly 1.x architecture solutions to be changed Split different transports logic, as it makes mess No Controller NIO Transport <-1 : 1-> SelectorHandler <-1 : 1-> SelectionKeyHandler. No copies, no clones. Unify SelectionKey events processing: client and server side connections will be processed the same way Unify SelectionKey attachments

2.1 Grizzly 1.x architecture solutions to be changed (cont.) ConnectorHandler will be responsible just for client ”connect” phase.

Agenda Grizzly 2.0 goals Architecture Grizzly 1.x architecture solutions to be changed Abstractions overview Examples

2.2.1 Transport Represents one specific transport implementation Configuration Thread pool Memory/ByteBuffer manager Connection IO events processing logic Life-cycle control: start, pause, resume, stop

2.2.2 Connection Represents connection unit in Grizzly, both server and client side Implements basic IO operations: read, write, close Hides protocol specifics, NIO complexity Could be used to store connection state/attributes

2.2.3 IOEventProcessor Common interface for processing IO events, occurred on the connection CallbackHandler and ProtocolChain implement IOEventProcessor It's easy to write custom IOEventProcessor: public void process(IOEventContext context) throws IOException;

2.2.4 IOEventProcessorSelector Incapsulates logic for selecting appropriate IOEventProcessor(s) to process specific IO event Is associated with Transport, although each specific connection unit, can have its own selector, which has higher priority public boolean injectEventProcessors(int connectionOp, Connection connection, IOEventProcessorChain eventProcessorChain);

2.2.5 MemoryManager Manages memory allocation, release operations Associated with a Transport Default implementations: ByteBufferManager, ByteBufferViewManager public interface MemoryManager<E> { public E allocate(int size); public E reallocate(E oldBuffer, int newSize); public void release(E buffer); }

2.2.6 ThreadPool Currently its API was taken from Grizzly 1.x Associated with a Transport Needs to be compatible with JDK ThreadPool?

2.2.7 Attribute Typed Attribute implementation (proposed by Ken) Compile time attribute types check Example: Attribute<Integer> lengthAttr; AttributeHolder session; public void setLength(int length) { lengthAttr.set(session, length); } public int getLength() { return lengthAttr.get(session);

Agenda Grizzly 2.0 goals Architecture Grizzly 1.x architecture solutions to be changed Abstractions overview Examples

3.1 Start and stop the Transport TCPNIOTransport transport = new TCPNIOTransport(); try { transport.bind(7777); transport.start(); } finally { transport.stop(); }

3.2 Blocking client write TCPNIOConnectorHandler connectorHandler = new TCPNIOConnectorHandler(transport); try { IOFuture<NIOConnection> future = connectorHandler.connectAsync("localhost", 7777); NIOConnection connection = future.get(10, TimeUnit.SECONDS); connection.write(someBuffer); } finally { connectorHandler.close(); }

3.3 Async client write TCPNIOConnectorHandler connectorHandler = new TCPNIOConnectorHandler(transport); ....................................... IOFuture writeFuture = connection.writeAsync(someBuffer); WriteResult writeResult = writeFuture.get(10, TimeUnit.SECONDS);

3.4 Filter chain write public class CustomFilter extends AbstractFilter { public boolean execute(IOEventContext ctx) throws IOException { ..................... ByteBuffer response = getResponse(); // Filter's filterWrite performs some Filter specific // response transformation and call filterWrite // on previous Filter in chain until it comes to // TransportFilter, which will send response on a wire IOFuture future = filterWriteAsync(ctx, response); }

3.5 Filter chain write (cont.) public class CustomFilter extends AbstractFilter { public boolean execute(IOEventContext ctx) throws IOException { ..................... ByteBuffer response = getResponse(); // It's possible to send response directly on a wire IOFuture future = ctx.getConnection().writeAsync(response); }

Grizzly 2.0 Initial propose overview 23