CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.
-
Upload
iris-stewart -
Category
Documents
-
view
220 -
download
0
Transcript of CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.
![Page 1: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/1.jpg)
CIFS in Alfresco 4.0
Mark Rogers
Senior Software Engineer, Alfresco
![Page 2: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/2.jpg)
Introduction
![Page 3: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/3.jpg)
CIFS and Alfresco in 4.0
Overview
• Explain some of the issues in previous versions
• Present the options for changes
• How you configure shuffle scenarios
• Q & A
• Lunch!
![Page 4: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/4.jpg)
CIFS and JLAN and Alfresco
JLAN
AlfrescoDB Driver
FTPNFSCIFS
![Page 5: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/5.jpg)
CIFS and JLANFile State Cache
• Packet level metadata• Last modified• File size
• Locks
• Session Information
Protocol Handler
Alfresco
CIFS
File State Cache
![Page 6: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/6.jpg)
CIFS v Alfresco
CIFS• File/Folder• Hard coded metadata• No Versioning• Packet Level Protocol• Create, Read, Write, • Delete, Rename• Many levels of locking• Multiple separate
operations.
• Body Level Two• Body Level Three
• Body Level Four
Alfresco• Content and metadata• Versioning• Stream Based• Optimistic locking• Many associations• Coarse transactions
![Page 7: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/7.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
File A
![Page 8: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/8.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
• Create Temp File
File A Temp
File
![Page 9: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/9.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
• Create Temp File
• Renamed
File A Temp
File
Old File
![Page 10: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/10.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
• Create Temp File
• Renamed
• Temp File
moved into place
File A Temp
File
Old File
![Page 11: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/11.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
• Create Temp File
• Renamed
• Temp File
moved into place
• Existing file
deleted
File A Temp
File
Old File
![Page 12: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/12.jpg)
Issues
![Page 13: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/13.jpg)
CIFS and Alfresco
Issues• Automated Testing
• Transaction boundary
• Scenario Handling
• Alfresco Clustering
• Error Handling
• Logging
![Page 14: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/14.jpg)
Issues
Automated testing
• Starting with Alfresco 3.4 there are an increasing set of tests for the Alfresco Content Disk Driver.
Issues• Automated Testing• Clustering• Transaction boundary• Error Handling• Logging• Shuffle Scenarios
![Page 15: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/15.jpg)
Issues
Clustering
• Alfresco dependency upon file state cache reduced/removed.
• JLAN clustered file state cache.
• Fixed Node Monitor
Issues• Automated Testing• Clustering• Transaction boundary• Error Handling• Logging• Shuffle Scenarios
![Page 16: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/16.jpg)
Issues
Transaction boundary
• Moved transaction boundary down to alfresco
• Removed all dependency on transactional data from the file state cache
Issues• Automated Testing• Clustering• Transaction boundary• Error Handling• Logging• Shuffle Scenarios
![Page 17: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/17.jpg)
Issues
Error Handling
• Rework
Issues• Automated Testing• Clustering• Transaction boundary• Error Handling• Logging• Shuffle Scenarios
![Page 18: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/18.jpg)
Issues
Logging
• “Alfresco style” log4j logging for Disk Driver and other alfresco code.
Issues• Automated Testing• Clustering• Transaction boundary• Error Handling• Logging• Shuffle Scenarios
![Page 19: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/19.jpg)
Issues
Shuffle
• A new framework/engine for dealing with “shuffle scenarios”
• Remove all hard coded “shuffle logic
• Move all shuffle state out of the transactional layers.
Issues• Automated Testing• Clustering• Transaction boundary• Error Handling• Logging• Shuffle Scenarios
![Page 20: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/20.jpg)
CIFS Shuffles
![Page 21: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/21.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
• Create Temp File
• Renamed
• Temp File
moved into place
• Existing file
deleted
File A Temp
File
Old File
![Page 22: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/22.jpg)
CIFS Rename ShuffleCIFS Operations
• File Exists
• Rename File
• Create New File
• Delete Temp File
• Scenario Fires
File A File A
~
![Page 23: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/23.jpg)
CIFS Shuffles
Approaches• The sausage machine • The “watchers”
![Page 24: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/24.jpg)
CIFS Shuffles
Shuffle
• Simple operations such as “does file A exist” need to read the cached instructions in the pipeline in addition to getting the state from the repo…
• Data loss on crashing!
The sausage machine
• CIFS Commands go into a pipeline and once we have a complete scenario we update the repo with a complete coarse grained transaction.
![Page 25: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/25.jpg)
CIFS Shuffles
Shuffle
• Scenarios compete
• At the end of each command alfresco is in a known persistent state.
• As and when scenarios fire they can “counter transact” previous behaviour.
The watchers
• CIFS Commands go through a set of scenarios which say what to do. The highest priority scenario wins.
• The scenarios contain their own state.
• Many scenarios run at once
![Page 26: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/26.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
File A
![Page 27: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/27.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
• Create Temp File
File A Temp
File
![Page 28: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/28.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
• Create Temp File
• Rename
• Scenario Fires
File A Temp
File
Old File
1.Copy Content
2.Rename temp file
to Old File
3.Rename File A to
Temp File
![Page 29: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/29.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
• Create Temp File
• Rename
• Scenario Fires
• Temp File
moved into place
• Existing file
deleted
File A Temp
File
Old File
1.Copy Content
2.Rename temp file 3.Rename File A
![Page 30: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/30.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
• Create Temp File
• Rename
• Scenario Fires
• Temp File
moved into place
File A Temp
File
Old File
![Page 31: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/31.jpg)
CIFS Create ShuffleCIFS Operations
• File Exists
• Create Temp File
• Rename
• Scenario Fires
• Temp File
moved into place
• Old file deleted
File A
Old File
![Page 32: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/32.jpg)
Architecture
JLAN
Buffered Content Disk Driver
Non Transactional Disk Driver
Content Disk Driver 2
Filesystem Command Executor
Rule Evaluator
Scenario
![Page 33: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/33.jpg)
CIFS Shuffles
Scenarios• Scenario Create• Scenario Rename• Scenario Create Delete Rename• Scenario Double Rename• Scenario Open File• Scenario Simple Non Buffered
• And others …
![Page 34: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/34.jpg)
Configuration
![Page 35: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/35.jpg)
Network-protocol-context.xml <property name="scenarios"> <list> <!-- TextEdit Mac Lion --> <bean id="tempDeleteShuffle" class="org.alfresco.filesys.repo.rules.ScenarioTempDeleteShuffle"> <property name="pattern"><value>^.*\.txt$</value></property> <property name="tempDirPattern"><value>.*(\\\..*\\)+.*</value></property> <property name="timeout"><value>60000</value></property> <property name="ranking"><value>HIGH</value></property> </bean> <!-- Excel 2003 --> <bean id="createShuffleExcel2003" class="org.alfresco.filesys.repo.rules.ScenarioCreateShuffle"> <property name="pattern"><value>[0-9A-F]{8}+$</value></property> <property name="timeout"><value>60000</value></property> <property name="ranking"><value>HIGH</value></property> </bean> <!-- Word 2003 --> <bean id="createShuffle2003" class="org.alfresco.filesys.repo.rules.ScenarioCreateShuffle"> <property name="pattern"><value>~WRD.*.TMP</value></property> <property name="timeout"><value>60000</value></property> <property name="ranking"><value>HIGH</value></property> </bean>
![Page 36: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/36.jpg)
Scenario Instance/** * A scenario is a factory for scenario instances. * */public interface Scenario{ /** * Create a new ScenarioInstance * <p> * If the scenario is interested in the specified operation then * return a new scenario instance. * @param currentInstances the current instances of all scenarios. * @param operation the operation to be performed * @return the scenario instance or null if a new instance is not required. */ ScenarioInstance createInstance(EvaluatorContext ctx, Operation operation); }
![Page 37: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/37.jpg)
Scenario/** * A scenario instance is an active scenario. It has a ranking, an * evaluate method and knows whether it is complete. * <p> * The evaluate method is called repeatedly as operations are processed. */public interface ScenarioInstance{ /** * Get the Ranking * @return */ public Ranking getRanking(); /** * evaluate the scenario against the current operation * * @param operation */ public Command evaluate(Operation operation); /** * Is the scenario complete? * * @return */ public boolean isComplete(); }
![Page 38: CIFS in Alfresco 4.0 Mark Rogers Senior Software Engineer, Alfresco.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e0c5503460f94af5c71/html5/thumbnails/38.jpg)
Lunch !